From f5d011cb82aac8aec0532f6e87c5a10b06ef6b82 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 9 May 2020 13:57:03 +0200 Subject: [PATCH] Filter reactive tx managers in TransactionAttributeSourceClassFilter Prior to this commit, the TransactionAttributeSourceClassFilter filtered out PlatformTransactionManager but not ReactiveTransactionManager implementations. TransactionAttributeSourceClassFilter now filters out any TransactionManager implementation, covering both imperative and reactive transaction managers. --- .../interceptor/TransactionAttributeSourcePointcut.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourcePointcut.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourcePointcut.java index cefacfc289..ceef2bd82f 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourcePointcut.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSourcePointcut.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,11 @@ import org.springframework.aop.ClassFilter; import org.springframework.aop.support.StaticMethodMatcherPointcut; import org.springframework.dao.support.PersistenceExceptionTranslator; import org.springframework.lang.Nullable; -import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.TransactionManager; import org.springframework.util.ObjectUtils; /** - * Inner class that implements a Pointcut that matches if the underlying + * Abstract class that implements a Pointcut that matches if the underlying * {@link TransactionAttributeSource} has an attribute for a given method. * * @author Juergen Hoeller @@ -87,7 +87,7 @@ abstract class TransactionAttributeSourcePointcut extends StaticMethodMatcherPoi @Override public boolean matches(Class clazz) { if (TransactionalProxy.class.isAssignableFrom(clazz) || - PlatformTransactionManager.class.isAssignableFrom(clazz) || + TransactionManager.class.isAssignableFrom(clazz) || PersistenceExceptionTranslator.class.isAssignableFrom(clazz)) { return false; }