When I am on a spring service and I want to update several database tables through spring repositories, do I need to add @Transactional to make sure I am transactional and rollback or is it already there? If yes, do I need to add it to the class level or method?
The answer is Yes, you need to add it separately. For more details, please refer:
What is the difference between defining @Transactional on class vs method
and
Spring - @Transactional - What happens in background?
and
https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html#tx-decl-explained
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With