Question
What happens if you annotate a private method with @Transactional?
A. Transaction is applied
B. Runtime exception
C. It is silently ignored
D. Only rollback is active
Answer
It is silently ignored.
Why?
Spring’s Transactional relies on AOP proxies. These proxies only intercept public methods when called from outside the proxy. So if we annotate a private method with Transactional, Spring does not apply any transaction. No runtime exception is thrown, and rollback won't work either. It simply gets ignored.
From Spring Docs:
Check out the docs