I have a @Transactional(REQUIRED) method that invokes a @Transactional(REQUIRES_NEW). The default behaviour I am seeing is the inner transaction is being rolled back, but the outer is being committed. Is this the expected behaviour?
I have a @Transactional(REQUIRED) method that invokes a @Transactional(REQUIRES_NEW). The default behaviour I am
Share
Yes, it is the expected behavior. The outer transaction is suspended while the inner transaction is executed. Once the inner transaction ends (whether it’s a commit or rollback), the outer transaction resumes.
BTW, the documentation says it: