2 Replies Latest reply on Sep 8, 2004 11:07 AM by Neil Parkes

    inet opta XADataSource problem

    Neil Parkes Newbie

      Hi

      having problems setting up an XADataSource to SQLServer using the inet opta driver.

      I am using jboss 3.2.5 on windows 2000, connecting to SQL Server 2000 running on windows 2000 server. I'm afraid I don't know the version of the opta driver as there is no indication in the gate.jar that I have (it was compiled on 7th August 2002).

      My application works fine when I use a local data source and the com.inet.tds.TdsDriver, and works (mainly) fine with the XADataSource, but I find that there is an intermittent fault with connections failing to be registered in transactions. Of course the answer is to not use an XADataSource, but I need to be sure that I can set up an XADataSource in future.

      Here is my data source:

      <xa-datasource>
       <jndi-name>ResultDatabase</jndi-name>
       <track-connection-by-tx/>
       <isSameRM-override-value>false</isSameRM-override-value>
       <xa-datasource-class>com.inet.tds.XDataSource</xa-datasource-class>
       <xa-datasource-property name="ServerName">emalonmsq25</xa-datasource-property>
       <xa-datasource-property name="Port">1433</xa-datasource-property>
       <xa-datasource-property name="DatabaseName">ResultsDevNP</xa-datasource-property>
       <user-name>JDBC_RESULTS_NP</user-name>
       <password>i81u812</password>
       <min-pool-size>2</min-pool-size>
       <max-pool-size>25</max-pool-size>
       <blocking-timeout-millis>5000</blocking-timeout-millis>
       <idle-timeout-minutes>15</idle-timeout-minutes>
       <check-valid-connection-sql>SELECT COUNT(*) FROM sysobjects</check-valid-connection-sql>
       <track-statements>true</track-statements>
       </xa-datasource>


      and here is the trace. I've listed the successful transaction (//29) which predates the failed transaction (//30). Note that every time I run jboss it is always transaction 30 that is the first to go, followed by about 9 others (in the first 100 or so). Note also that if I clear out the database (my app is only StatelessSessionBeans using direct database access through bean managed transaction) and run my client again then I don't get any transaction failures. Weird.

      2004-09-02 17:40:21,153 TRACE [org.jboss.tm.TxManager] commited tx: TransactionImpl:XidImpl [FormatId=257, GlobalId=B000BCD6F897F//29, BranchQual=]
      2004-09-02 17:40:21,153 TRACE [org.jboss.tm.TxManager] tx timeout is now: 0s
      2004-09-02 17:40:21,153 TRACE [org.jboss.tm.TransactionImpl] Created new instance for tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=B000BCD6F897F//30, BranchQual=]
      2004-09-02 17:40:21,153 TRACE [org.jboss.tm.TxManager] began tx: TransactionImpl:XidImpl [FormatId=257, GlobalId=B000BCD6F897F//30, BranchQual=]
      2004-09-02 17:40:21,153 TRACE [org.jboss.resource.connectionmanager.CachedConnectionManager] user tx started, key: org.jboss.resource.connectionmanager.CachedConnectionManager$KeyConnectionAssociation@b45130
      2004-09-02 17:40:21,153 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] subject: null
      2004-09-02 17:40:21,153 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] supplying ManagedConnection from pool: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@2b2057[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@158497c handles=0 lastUse=1094143221153 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1408325 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@623367]
      2004-09-02 17:40:21,153 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Getting connection from pool org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@2b2057[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@158497c handles=0 lastUse=1094143221153 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1408325 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@623367] [InUse/Available/Max]: [1/24/25]
      2004-09-02 17:40:21,153 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] enlisting currenttx: TransactionImpl:XidImpl [FormatId=257, GlobalId=B000BCD6F897F//30, BranchQual=], ManagedConnection: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@158497c
      2004-09-02 17:40:21,153 TRACE [org.jboss.tm.TransactionImpl] enlistResource(): Entered, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=B000BCD6F897F//30, BranchQual=] status=STATUS_ACTIVE
      2004-09-02 17:40:21,153 TRACE [org.jboss.tm.TransactionImpl] startResource(XidImpl [FormatId=257, GlobalId=B000BCD6F897F//30, BranchQual=1]) entered: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@158497c flags=0
      2004-09-02 17:40:21,168 TRACE [org.jboss.tm.TransactionImpl] startResource(XidImpl [FormatId=257, GlobalId=B000BCD6F897F//30, BranchQual=1]) leaving: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@158497c flags=0
      2004-09-02 17:40:21,168 WARN [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=B000BCD6F897F//30, BranchQual=] errorCode=XA_UNKNOWN(0)
      javax.transaction.xa.XAException: [EMALONMSQ25]Cannot enlist in the transaction because the transaction does not exist.
      at com.inet.tds.o.if(Unknown Source)
      at com.inet.tds.o.start(Unknown Source)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:132)
      at org.jboss.tm.TransactionImpl.startResource(TransactionImpl.java:1196)
      at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:649)
      at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:448)
      at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:337)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:502)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
      at av.reporting.ejb.SQLHelper.getConnection(SQLHelper.java:364)
      at av.reporting.ejb.ResultWriterBean.getConnectionAndInitCaches(ResultWriterBean.java:4701)
      at av.reporting.ejb.ResultWriterBean.writeResultSimpleValue(ResultWriterBean.java:1726)
      at av.reporting.ejb.ResultWriterBean.writeResult(ResultWriterBean.java:824)
      at av.reporting.ejb.ResultWriterBean.writeResults(ResultWriterBean.java:578)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      ...


      thanks

      Neil

        • 1. Re: inet opta XADataSource problem
          Adrian Brock Master

          It looks like a bug in driver:


          2004-09-02 17:40:21,168 TRACE [org.jboss.tm.TransactionImpl] startResource(XidImpl [FormatId=257, GlobalId=B000BCD6F897F//30, BranchQual=1]) leaving: org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@158497c flags=0
          2004-09-02 17:40:21,168 WARN [org.jboss.tm.TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=B000BCD6F897F//30, BranchQual=] errorCode=XA_UNKNOWN(0)
          javax.transaction.xa.XAException: [EMALONMSQ25]Cannot enlist in the transaction because the transaction does not exist.
          at com.inet.tds.o.if(Unknown Source)
          at com.inet.tds.o.start(Unknown Source)
          at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:132)
          at org.jboss.tm.TransactionImpl.startResource(TransactionImpl.java:1196)
          at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:649)


          JBoss is telling the XAResource about a new transaction/xid (flags=0)
          so why it should complain about "transaction does not exist" is anybody's guess?

          • 2. Re: inet opta XADataSource problem
            Neil Parkes Newbie

             

            "adrian@jboss.org" wrote:
            It looks like a bug in driver:

            JBoss is telling the XAResource about a new transaction/xid (flags=0)
            so why it should complain about "transaction does not exist" is anybody's guess?


            Well quite. I no longer have a support contract with INet so I can't get a new driver. I'll see if I can get one and let you know if that helps.