5 Replies Latest reply on Jun 15, 2010 8:29 AM by jmesnil

    Local Transactions on the Resource Adapter

    clebert.suconic

      As part of adding the cached sessions on the ManagedConnection, Jeff had also removed the possibility of using local Transactions. (isXA, isTransacted).

       

      We don't want to support that any more?

       

      I'm not re-enabling that part. I'm just double checking if that's really what we wanted to do.

        • 1. Re: Local Transactions on the Resource Adapter
          timfox

          That stuff shouldn't be necessary, even though we still support local transactions.

           

          It's the app server that decides to use local transactions or not, by calling getLocalTransaction(), not something that is configured.

          • 2. Re: Local Transactions on the Resource Adapter
            jmesnil

            I think the code for local transaction in the RA is broken in the trunk.

             

            in HornetQRAManagedConnection.setup(), we create a single JMS session through createXASession().getSession().

             

            If the app server then call getLocalTransaction() on the RA, we will in fact use a XA session and it will throw an exception when calling commit() or rollback() on the local tx.

             

            I'm fixing this to create either a XASession (if the connection request info says to use XA) or a regular transacted session.

            Then, in getSession(), I can either return xaSession.getSession() (if xaSession has been created) or the transacted session.

             

            I'm adding the patch. Could someone have a look to double check while I am testing it?

            • 3. Re: Local Transactions on the Resource Adapter
              ataylor

              Jeff Mesnil wrote:

               

              I think the code for local transaction in the RA is broken in the trunk.

               

              in HornetQRAManagedConnection.setup(), we create a single JMS session through createXASession().getSession().

               

              If the app server then call getLocalTransaction() on the RA, we will in fact use a XA session and it will throw an exception when calling commit() or rollback() on the local tx.

               

              I'm fixing this to create either a XASession (if the connection request info says to use XA) or a regular transacted session.

              Then, in getSession(), I can either return xaSession.getSession() (if xaSession has been created) or the transacted session.

               

              I'm adding the patch. Could someone have a look to double check while I am testing it?

              will do

              • 4. Re: Local Transactions on the Resource Adapter
                timfox

                Can you make sure there are tests for this too?

                • 5. Re: Local Transactions on the Resource Adapter
                  jmesnil