Fix regression in determineTransactionManager
The fix in cec26e9 for SPR-12541 actually introduced a regression
when the interceptor is enabled on a method that does not require any
transaction. In such a case we try to locate the default
PlatformTransactionManager instead of just returning what we have (that
is null).
This commit updates the determineTransactionManager condition again to
take that use case into account again.
Issue: SPR-12541
This commit is contained in:
@@ -139,6 +139,14 @@ public class TransactionInterceptorTests extends AbstractTransactionAspectTests
|
||||
assertSame(transactionManager, ti.determineTransactionManager(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void determineTransactionManagerWithNoTransactionAttribute() {
|
||||
BeanFactory beanFactory = mock(BeanFactory.class);
|
||||
TransactionInterceptor ti = createTestTransactionInterceptor(beanFactory, null);
|
||||
|
||||
assertNull(ti.determineTransactionManager(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void determineTransactionManagerWithQualifierUnknown() {
|
||||
BeanFactory beanFactory = mock(BeanFactory.class);
|
||||
|
||||
Reference in New Issue
Block a user