Tag Archives: Spring transaction

When & How to use Spring boot @Transactional?

Abstract

The @Transactional annotation is probably the most randomly used annotation in the whole Java development world – and it’s terrifying!

There are many misconception about how & and where to use @Transactional annotations in spring boot application. I came across this awesome tutorial and it is worth reading it.

Common pitalls are:

  • Pitfall #1: Redundant @Transactional or JPA calls
  • Pitfall #2: @Transactional ignored?
  • Pitfall #3: @Transactional(readOnly = true)
  • Pitfall #4: Rollbacks
  • Pitfall #5: Propagation modes and isolation levels

Read more in

https://codete.com/blog/5-common-spring-transactional-pitfalls/

https://medium.com/chain-analytica/how-to-manage-transactions-in-spring-boot-using-annotations-cbee57fe6e73