1 Reply Latest reply on Dec 15, 2004 8:35 PM by alt_amit

    allowGlobalTxnModeOnly() throws exception in XAOracleDS

    alt_amit

      I am getting the following error on jboss4.0 rc1 and oracle 9.2.0.5.0 while running the cmproster example with XAConnection. Basically allowGlobalTxnModeOnly() finds transactionmode != 2 and throws exception (thru decompiled code of the driver class).
      My oracle-xa-ds.xml is below:

      <xa-datasource>
      <jndi-name>XAOracleDS</jndi-name>
      <track-connection-by-tx/>
      <isSameRM-override-value>false</isSameRM-override-value>
      <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource
      -class>
      <xa-datasource-property name="URL">jdbc:oracle:oci8:@orasvc1</xa-datasource-
      property>
      <xa-datasource-property name="User">jboss</xa-datasource-property>
      <xa-datasource-property name="Password">password</xa-datasource-property>
      <!-- Uses the pingDatabase method to check a connection is still valid befor
      e handing it out from the pool -->
      <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vend
      or.OracleValidConnectionChecker</valid-connection-checker-class-name-->
      <!-- Checks the Oracle error codes and messages for fatal errors -->
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleEx
      ceptionSorter</exception-sorter-class-name>
      <!-- Oracles XA datasource cannot reuse a connection outside a transaction o
      nce enlisted in a global transaction and vice-versa -->
      <no-tx-separate-pools/>

      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional
      ) -->

      <type-mapping>Oracle9i</type-mapping>

      </xa-datasource>


      <depends optional-attribute-name="TransactionManagerService">jboss:service=T
      ransactionManager





      The error is below:

      2004-11-19 17:58:42,045 WARN [org.jboss.tm.TransactionImpl] XAException: tx=Tra
      nsactionImpl:XidImpl[FormatId=257, GlobalId=AMIT-DEV/15, BranchQual=, localId=15
      ] errorCode=XAER_RMERR^M
      javax.transaction.xa.XAException^M
      at oracle.jdbc.xa.OracleXAResource.allowGlobalTxnModeOnly(OracleXAResour
      ce.java:1069)^M
      at oracle.jdbc.xa.OracleXAResource.suspendStacked(OracleXAResource.java:
      296)^M
      at oracle.jdbc.xa.client.OracleXAResource.end(OracleXAResource.java:381)

        • 1. Re: allowGlobalTxnModeOnly() throws exception in XAOracleDS
          alt_amit

          the problem happens on both jboss 4.0 and 3.2.6. So I used the OracleDS instead of the XAOracleDS (which is for 2 phase commit, which is needed if xaction spans multiple db's which is not my case),and things worked. Of course, the transition from hsqldb to Oracle 9i needed some fixing of the jbosscmp-jdbc.xml (like LCASE to LOWER, renaming attributes like desc to something else as desc is a keyword in Oracle, drop the auto-increment feature and use oracle-sequence etc).