0 Replies Latest reply on May 10, 2010 4:00 PM by Jacques-Olivier Goussard

    enlist fails and rollback doesn't close connection

    Jacques-Olivier Goussard Newbie

      Hi

      I'm seeing the following issue with JBoss JTA: if ConnectionImple fails to enlist the connection in the transaction, the

      transaction is correctly set as ROLLBACK_ONLY, then I do the rollback but the connection is not dis-associated from

      the transaction, leading to errors 'com.arjuna.ats.internal.jdbc.alreadyassociatedcheck' when the connection is

      re-used on other transcations.

      Looking at ConnectionImple#registerDatabase(), where the enlist occurs, I see that the transaction association

      is done before the enlist call - is this OK? I'm just wondering if this could be the issue: transaction association is

      done, but resource is not enlisted, so an abort will not delist it (and dis-associate).

       

      protected final synchronized void registerDatabase() throws SQLException
          {

      ....

      // -> Associate connection with transaction

      if (!_recoveryConnection.setTransaction(tx))
                          throw new SQLException(
                                  jdbcLogger.logMesg
                                          .getString("com.arjuna.ats.internal.jdbc.alreadyassociated"));

      ...

      // -> If enlist failed, simply mark as rollback only

                   if (!((com.arjuna.ats.jta.transaction.Transaction) tx)
                              .enlistResource(xares, params))
                      {
                          /*
                           * Failed to enlist, so mark transaction as rollback only.
                           */

       

                          try

                          {
                              tx.setRollbackOnly();
                          }