1 Reply Latest reply on Nov 1, 2012 7:37 PM by Tom Jenkinson

    Transactions and Connections behaviour

    Dmitriy Reshetnikov Newbie

      Can you explane, what is going on there:

      1. connection = getConnection

      2. userTransaction.begin()

       

      Is connection included into transaction?

      Is connection used by another local transaction and do not included into UserTransaction

       

      1. userTransaction.begin()

      2. connection = getConnection

      3. userTransaction.commit

      4. connection.doSmt()

       

      Can I use connection after transaction commit?

        • 1. Re: Transactions and Connections behaviour
          Tom Jenkinson Master

          Hi Dmitriy,

           

          Your question is probably better asked over on the IronJacamar forums. From what I can recall, the XA connection is enlisted for you by iron jacamar when you request a connection within the scope of a transaction.

           

          1. it would be an error to use an XA connection outside the scope of a transaction, so I would say, "no" to using it after the commit

          2. If you call getConnection outside the scope of transaction I would say you will get a standard connection rather than an XA one, it does depend on the capabilities of the underlying connection manager, in AS7 case: IronJacamar.

           

          Tom