Spring Transaction Management - SirajChaudhary/comprehensive-example-on-microservices-using-spring-boot-with-spring-cloud GitHub Wiki
how to configure spring transaction management
Step1: Add following annotation on class level at service layer.
@Transactional(readOnly = true)
Step2: Add following annotation on create, update, delete methods which hits the DB.
@Transactional
Step3: Make sure if we are using caching (e.g. @Cacheable) with transaction management (e.g. @Transactional) then add following ordering annotations on main class otherwise the caching won't work.
@EnableCaching(order = 1)
@EnableTransactionManagement(order = 2)