1

I've created a simple application using Spring Boot, Kotlin & Mongodb. Now I would like to use the @Transactional annotation in the test CustomerServiceIntegrationTest to make sure each test case rolls back any changes it did to the database.

When I add @Transactional I get the message Failed to retrieve PlatformTransactionManager for @Transactional test.

Writing to the db otherwise works fine.

What did I miss?

https://github.com/urswiss/customer

Urs
  • 181
  • 1
  • 5
  • check this: https://stackoverflow.com/questions/21386449/spring-data-and-mongodb-simple-roll-back-with-spring-within-transactional and https://spring.io/blog/2018/06/28/hands-on-mongodb-4-0-transactions-with-spring-data it all depends on the versions you are using – Jorge C Oct 01 '18 at 10:55
  • 1
    Possible duplicate of [Failed to retrieve PlatformTransactionManager for @Transactional test for test context](https://stackoverflow.com/questions/37344471/failed-to-retrieve-platformtransactionmanager-for-transactional-test-for-test-c) – Alien Oct 01 '18 at 11:04
  • So it’s because Mongo has no transactions. Thanks! – Urs Oct 02 '18 at 06:15

0 Answers0