Announcement Announcement Module
Collapse
No announcement yet.
rollback open transactions at a central place Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • rollback open transactions at a central place

    I have the problem that I want to rollback an open transaction at a central place. The transaction is started at several places in the code. The TransactionStatusObject is not available at the central place. I tried to create a new TransactionStatusObject "status" object (default propagation level) and provided it to the getTransactionManager().rollBack(status). But this sets only the open transaction to rollback-only.
    Is there a way to force a rollback?

  • #2
    Throw an unchecked exception.

    Comment


    • #3
      If you are using declarative transaction management, the transaction status is bound to the thread. You can simply use:
      Code:
      TransactionAspectSupport.currentTransactionStatus().setRollbackOnly().

      Comment

      Working...
      X