Support for @Transactional
and R2dbcTransactionManager
in spring-test
#31193
Labels
in: data
Issues in data modules (jdbc, orm, oxm, tx)
in: test
Issues in the test module
status: duplicate
A duplicate of another issue
Affects: 5.3.29
I have a Spring project that uses Spring Data R2DBC with Oracle driver, I created the required
ConnectionFactory
andReactiveTransactionManager
and I use@Transactional
in the required methods. Spring correctly usesReactiveTransactionManager
instead ofPlatformTransactionManager
to manage these Spring-managed transactions and there is no problem. But it is different in tests, as we know if@Transactional
is used in test cases, it is considered as Test-managed transactions and will be automatically rolled back after completion of the test.although
ConnectionFactory
andReactiveTransactionManager
are configured correctly, Spring tries to usePlatformTransactionManager
instead ofReactiveTransactionManager
for Test-managed transactions. As a result, the following error is given:After this issue, I searched a little in the
spring-test
code, and by examining theorg.springframework.test.context.transaction.TransactionalTestExecutionListener
class, I came to the conclusion that Spring only supportsPlatformTransactionManager
in the test environment.Is my conclusion correct, and we should wait for the support of
ReactiveTransactionManager
in new versions of spring-test, or is there a problem with my configuration and usage?This is similar to my
ConnectionFactory
andReactiveTransactionManager
configuration in the code environment:and this is
ConnectionFactory
andReactiveTransactionManager
configuration in the test environment:The text was updated successfully, but these errors were encountered: