Skip to content

Files

Latest commit

 

History

History

HibernateSpringBootWhyTransactionalIsIgnored

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Why the @Transactional annotation is being ignored

Description: This application is an example of fixing the case when @Transactional annotation is ignored. Most of the time, this annotation is ignored in the following scenarios:

  1. @Transactional was added to a private, protected or package-protected method
  2. @Transactional was added to a method defined in the same class where it is invoked

Key points:

  • write a helper service and move the @Transactional methods there
  • ensure that these methods are declared as public
  • call @Transactional methods from other services

If you need a deep dive into the performance recipes exposed in this repository then I am sure that you will love my book "Spring Boot Persistence Best Practices"If you need a hand of tips and illustrations of 100+ Java persistence performance issues then "Java Persistence Performance Illustrated Guide" is for you.