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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.