1 Reply Latest reply on Nov 19, 2012 11:37 AM by jhalliday

    XAResource.start() not called on resume()???

    mattiasj

      JTA specification section 3.2.3:

      When the application’s transaction context is resumed, the application server ensures that the resource in use by the application is again enlisted with the transaction. Enlisting a resource as a result of resuming a transaction triggers the Transaction Manager to inform the resource manager to re-associate the resource object with the resumed transaction (XAResource.start(TMRESUME)).

       

      As far as I can tell, JBoss Transactions does not call XAResource.start() on resume().

      Is my understanding wrong when I read the spec as that it should?

      Is there anything else I'm missing here???

        • 1. Re: XAResource.start() not called on resume()???
          jhalliday

          JBossTS is not an application server, it's a transaction manager. It's not responsible for enlisting and delisting resources. That's the application server's job.  At the JTA API level, suspend/resume is purely about the relationship between the Thread and the Transaction.  That's distinct from the relationship between the resources and the Transaction.

           

          "...The *application server* is responsible for ensuring that the resources in use by the application are properly delisted from the suspended transaction. A resource delist operation [by the application server upon the transaction manager] triggers the Transaction Manager to inform the resource manager to disassociate the transaction from the specified resource object (XAResource.end(TMSUSPEND)). ... When the application’s transaction context is resumed, the *application server* ensures that the resource in use by the application is again enlisted with the transaction."

           

          In practice it's the EJB container and JCA that call enlist/delist and deal with the fun corner cases that arise when you e.g. keep a JDBC Connection open across transaction context boundaries.