java – Spring Boot With @Transactional annotated method, calls other transactional methods and throws an Exception
java – Spring Boot With @Transactional annotated method, calls other transactional methods and throws an Exception
Make sure that the method annotated with @Transactional
is declared as public
and called by a different class.
A transactional method must be public so that Spring can override it and it must be called from outside the defining class so that the invocation can go through a proxy.
Its one of the common pitfalls when using @Transactional, for more information see https://codete.com/blog/5-common-spring-transactional-pitfalls/