2 Replies Latest reply on Aug 23, 2003 10:21 AM by Adrian Brock

    Correct JTA Protocol

    Christian Harms Newbie

      Hi,

      we've build a connector providing the XAResource interface. The purpose of the connector is to encapsulate a database access layer which uses JDBC 2.0 compliant drivers.
      The design ensures that calls to the connectors XAResource interface are propagated to the XAConnections XAResource in a proper way. It's very similar to the way it is handled in the JBoss JDBC Connector.

      In normal conditions everything seem to work fine but as soon as we run multiple clients agains our test ejb we encounter the following transaction sequence over one Managed Connection and therefore one XAResource:

      start TMNOFLAGS of Transaction with XID1
      end TMSUSPEND of Transaction with XID1
      start TMNOFLAGS of Transaction with XID2
      end TMSUCCESS of Transaction with XID2
      ....

      The second end causes a XAException thrown by the DB2 XA Driver (errorCode=XAER_PROTO).

      Is DB2 not supporting the JTA spec in the right way or is JBoss running the protocol in an inconsistent way?

      We've also tried this with Oracle and it shows similar problems.

      Regards
      Christian

        • 1. Re: Correct JTA Protocol
          Christian Harms Newbie

          I forgot to provide information on the JBoss version: it's 3.2.2RC1

          • 2. Re: Correct JTA Protocol
            Adrian Brock Master

            There is much debate about this.
            The spec is contradictory.

            JBoss has:
            <track-connection-by-tx>true</track-connection-by-tx>
            for ResourceManagers that do not support reusing a suspended
            XA connection in a different transaction before it is committed.

            Our interpretation of the spec is that it should support it.
            It is the XAResource that should not be resused.
            Each new XID should create a new XAResource and
            different XIDs should not be active on the same connection
            at the same time.
            This gives you the full performance benefit of XA connection
            pooling.

            e.g.
            start XID1 (connection is XID1 XAResource1)
            suspend XID1 (connection has no XID so return to the pool)
            start XID2 (connection is XID2 XAResource2)
            commit XID1 (acts on XAResource1)
            commit XID2 (acts on XAResource2)

            can all be done on one connection rather than one for each XID

            In my experience few XA implements support this optimization.

            Regards,
            Adrian