Announcement Announcement Module
Collapse
No announcement yet.
UnexpectedRollbackException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • UnexpectedRollbackException

    I have the following strange scenario with spring's transaction management:

    I have method A which calls method B which calls method C, each of them in a different class. Methods B and C are both wrapped with transactions. Both use PROPAGATION_REQUIRED, so while spring creates two logical transactions, there is one physical transaction in the db.

    Now, in method C I throw a Exception. This sets the inner logical transaction as rollbackOnly and the physical transaction as well. In method B, I am aware of the possibility of Exception in B, so I catch the exception in B and process the execution of B normally and I dont throw any exception.

    I expect that the method A should not get any exception. Exception shouldn't throw the UnexpectedRollbackException
Working...
X