diff --git a/spring-test/src/main/java/org/springframework/test/context/transaction/TransactionalTestExecutionListener.java b/spring-test/src/main/java/org/springframework/test/context/transaction/TransactionalTestExecutionListener.java index 0cf9cab385..050523f67f 100644 --- a/spring-test/src/main/java/org/springframework/test/context/transaction/TransactionalTestExecutionListener.java +++ b/spring-test/src/main/java/org/springframework/test/context/transaction/TransactionalTestExecutionListener.java @@ -56,9 +56,14 @@ import static org.springframework.core.annotation.AnnotationUtils.*; * *

Changes to the database during a test that is run with {@code @Transactional} * will be run within a transaction that will, by default, be automatically - * rolled back after completion of the test. Test methods that are not - * annotated with {@code @Transactional} (at the class or method level) will not - * be run within a transaction. + * rolled back after completion of the test. Test methods that are + * not annotated with {@code @Transactional} (at the class or method + * level) will not be run within a transaction. Furthermore, test methods + * that are annotated with {@code @Transactional} but have the + * {@link org.springframework.transaction.annotation.Transactional#propagation propagation} + * type set to + * {@link org.springframework.transaction.annotation.Propagation#NOT_SUPPORTED NOT_SUPPORTED} + * will not be run within a transaction. * *

Transactional commit and rollback behavior can be configured via the * class-level {@link TransactionConfiguration @TransactionConfiguration} and @@ -67,10 +72,13 @@ import static org.springframework.core.annotation.AnnotationUtils.*; *

In case there are multiple instances of {@code PlatformTransactionManager} * within the test's {@code ApplicationContext}, {@code @TransactionConfiguration} * supports configuring the bean name of the {@code PlatformTransactionManager} - * that should be used to drive transactions. Alternatively, - * {@link TransactionManagementConfigurer} can be implemented in an + * that should be used to drive transactions. Alternatively, a qualifier + * may be declared via {@link Transactional#value} or + * {@link TransactionManagementConfigurer} can be implemented by an * {@link org.springframework.context.annotation.Configuration @Configuration} - * class. + * class. See {@link TestContextTransactionUtils#retrieveTransactionManager()} + * for details on the algorithm used to look up a transaction manager in + * the test's {@code ApplicationContext}. * *

When executing transactional tests, it is sometimes useful to be able to * execute certain set up or tear down code outside of a