@EnableTransactionManagement in Spring Boot

Probably you’re also using Spring Data. Calls on Spring Data repositories are by default surrounded by a transaction, even without @EnableTransactionManagement. If Spring Data finds an existing transaction, the existing transaction will be re-used, otherwise a new transaction is created.

@Transactional annotations within your own code, however, are only evaluated when you have @EnableTransactionManagement activated (or configured transaction handling some other way).

You can easily trace transaction behavior by adding the following property to your application.properties:

logging.level.org.springframework.transaction.interceptor=TRACE

(see Showing a Spring transaction in log)

Leave a Comment