Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-540

RegisterSynchronization fails if the transaction is already marked for rollback

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • EJB 3.0 RC7 - FD
    • EJB 3.0 RC6 - PFD
    • None
    • None

      I'm not sure whether this is an Hibernate or a JBoss TM bug.
      Whe we use tx.registerSynchronization( ... ); while the tx is marked for rollback we've got a

      javax.transaction.RollbackException: Already marked for rollback, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=null:1145985933918/20, BranchQual=null:1145985933918, localId=0:20]
      at org.jboss.tm.TransactionImpl.checkStatus(TransactionImpl.java:2735)
      at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:1528)
      at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:149)

      However it actually make sense for the persistence provider to register to the Tx to be able to delay the em.close() until the end of the transaction.

      And indeed, the new JTA spec maintenance, does not specify any issue with registering to a Tx marked for rollbacked.

      http://www.jcp.org/aboutJava/communityprocess/maintenance/jsr907/907-ChangeLog.html#registerInterposedSynchronization%28javax.transaction.Synchronization%29

      Any insight from the transaction guru is welcomed. This must be fixed before we cut Hibernate 3.2.0 and JBAS 4.0.4

            patriot1burke@gmail.com Bill Burke (Inactive)
            rhn-engineering-ebernard Emmanuel Bernard
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: