6 Replies Latest reply on Feb 22, 2003 3:56 PM by davidjencks

    Configuring XA Datasource problem :XAER_PROTO

    scobsb

      I am trying to configure a XADatasource for DB2 (using JBoss 3.0.2 & DB2 7.1).

      It seems to work fine, but sometimes (not systematically) my "getConnection" calls fail. This happens only if a transcation.begin() has been called before: up to know, I have never seen this problem when not in a transactional context.

      Here is the significant par of the Exception:

      11:17:53,258 WARN [TxCapsule] XAException: tx=XidImpl FormatId=257, GlobalId=b
      sbp17//2, BranchQual=] errorCode=XAER_PROTO
      javax.transaction.xa.XAException
      at COM.ibm.db2.jdbc.app.DB2XAResource.throwXAException(DB2XAResource.jav
      a:288)
      at COM.ibm.db2.jdbc.app.DB2XAResource.start(DB2XAResource.java:283)
      at org.jboss.tm.TxCapsule.startResource(TxCapsule.java:1200)
      at org.jboss.tm.TxCapsule.enlistResource(TxCapsule.java:686)
      at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:102)

      at org.jboss.resource.connectionmanager.XATxConnectionManager$XAConnecti
      onEventListener.enlist(XATxConnectionManager.java:262)
      at org.jboss.resource.connectionmanager.XATxConnectionManager.managedCon
      nectionReconnected(XATxConnectionManager.java:202)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC
      onnection(BaseConnectionManager2.java:534)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$Connectio
      nManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
      at org.jboss.resource.adapter.jdbc.JDBCDataSource.getConnection(JDBCData
      Source.java:110)
      at ...

      Can someone help?

      Sébastien Couturiaux

        • 1. Re: Configuring XA Datasource problem :XAER_PROTO
          davidjencks

          Can you determine if this occurs when a second connection is requested within one transaction? Any more information you can supply on the context in which this occurs would be helpful.

          • 2. Re: Configuring XA Datasource problem :XAER_PROTO
            scobsb

            This happens systematically at the first time a connection is asked in the first transaction started. Then it still happens quite often, but it is not systematic and seems not to be reproductible (I cannot determine a sequence of operations in my application that will induce the problem for sure).

            So, this is the first connection within the transaction.However, other connections in a non-transcational context have already succesfully been provided and closed.

            Note that the transaction is bean-managed. The UserTransaction is retrieved through a JNDI lookup and not through the ejb context. This was done only for design reasons. If you think that this can be the cause of the problem, I'll do some refactoring to be able to change this, but from what I understand of JTA and EJB's, this should be strictly equivalent???

            Thanks,

            Sebastien

            • 3. Re: Configuring XA Datasource problem :XAER_PROTO
              scobsb

              I have quickly made some changes to the code in order to retrieve the transaction from the SessionContext of my Session Bean instead of a JNDI lookup. I confirm that this does not change anything...

              Thanks for your help,

              Sebastien

              • 4. Re: Configuring XA Datasource problem :XAER_PROTO
                scobsb

                Still can't find any solution...
                Has someone already successfully used IBM DB2 with distributed transactions and JBoss 3?

                Thx,

                Sebastien

                • 5. Re: Configuring XA Datasource problem :XAER_PROTO

                  Hi,
                  have you found a solution for your problem ?
                  I'm using jboss 3.0.4 with db2 7.2 xa driver and the same error occurs ..

                  Thankx

                  • 6. Re: Configuring XA Datasource problem :XAER_PROTO
                    davidjencks

                    The xa support in 3.0 has not been satisfactory until now. I recommend trying with current cvs version or 3.2RC2. Make sure the TrackConnectionByTx flag is set to true: I think this will remove the circumstances in which this error occurred.