1 Reply Latest reply on Jul 14, 2004 12:16 AM by Adrian Brock

    Duplicate transaction Id seen with SQL Server

    Chalakanth Reddy Newbie


      We have implemented some distributed transactions with JBoss 3.2.3 over a SQLServer 2000 database. There is the Microsoft SQLServer JDBC driver and the JBoss default Transaction Manager in between.

      Now and then we see this error.

      WARN [org.jboss.tm.TransactionImpl] : XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=devwkstn15//55, BranchQual=] errorCode=XAER_RMERR
      javax.transaction.xa.XAException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]xa_start (40000) returns -8
      at com.microsoft.jdbcx.sqlserver.SQLServerImplXAResource.executeXaRpc(Unknown Source)
      at com.microsoft.jdbcx.sqlserver.SQLServerImplXAResource.start(Unknown Source)
      at com.microsoft.jdbcx.base.BaseXAResource.start(Unknown Source)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:143)
      at org.jboss.tm.TransactionImpl.startResource(TransactionImpl.java:1148)

      This inturn causes JBoss to throw this error

      INFO [org.jboss.resource.connectionmanager.TxConnectionManager] Could not enlist in transaction on entering meta-aware object!
      javax.transaction.SystemException: enlistResource failed
      at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:468)
      at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)

      The JDBC driver is returning an XA error code of '-8'. This seems to be XAER_DUPID, which according to the javadoc is

      The XID already exists

      Our system somehow gets into a state where the JBoss TM is generating a transaction id that is still active at either the JDBC driver or in the SQL Server database.

      Typically, we see this error immediately after we bounce the JBoss server, or perhaps afer we bounce the database. We are not sure which, mostly because we have been ignoring this error until now.

      Does our anyalysis makes sense? Do you think we would avoid this error if we always bounced the JBoss server and the SQLServer database together?

      thanks for the help.