Uploaded image for project: 'JBoss Web Server'
  1. JBoss Web Server
  2. JWS-1943

Oracle transaction issue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Critical
    • None
    • 5.4.0.GA
    • tomcat
    • None
    • False
    • False
    • Undefined

    Description

      ASF DBCP jira: https://issues.apache.org/jira/browse/DBCP-570

      A failure can be seen when using two connections from different DBCP pools to access Oracle in a single transaction. The pools must access the same database server/SID but the users must be different. In such cases, Oracle has issues that result in a failure at the point of connection enlistment:

       ... WARN [main] sun.reflect.NativeMethodAccessorImpl.invoke0 ARJUNA016089: TransactionImple.enlistResource - xa_start - caught: XAException.XAER_RMERR for < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a000264:a0d3:5fdbca1d:a, node_name=1, branch_uid=0:ffff0a000264:a0d3:5fdbca1d:c, subordinatenodename=null, eis_name=0 >
       oracle.jdbc.xa.OracleXAException: XAErr (-3): A resource manager error has occured in the transaction branch. ORA-24774 SQLErr (0)
       at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1092)
       at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:272)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:741)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:423)
       at org.apache.tomcat.dbcp.dbcp2.managed.TransactionContext.setSharedConnection(TransactionContext.java:109)
       at org.apache.tomcat.dbcp.dbcp2.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:157)
       at org.apache.tomcat.dbcp.dbcp2.managed.ManagedConnection.<init>(ManagedConnection.java:75)
       at org.apache.tomcat.dbcp.dbcp2.managed.ManagedDataSource.getConnection(ManagedDataSource.java:80)
       at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1563)
       at support.jboss.web.TransactionTest.executeSQL(TransactionTest.java:84)
      

      We also verified that the explanation/presumed cause is correct by using a Byteman based workaround (which is probably too aggressive for some cases but does work around the problem scenario) that simulates what is done by IronJacamar and what is suggested/discussed in [1] - i.e. force the OracleXAResource "true" return for isSameRM to be "false" (instead) via a proxy for the OracleXAResource implementation.

      RULE oracle.jdbc.xa.OracleXAResource.isSameRM.FALSE
      CLASS oracle.jdbc.xa.OracleXAResource
      METHOD isSameRM
      AT ENTRY
      IF true
      DO System.err.println("[BMAN] Overriding Oracle isSameRM ...");
       return false;
      ENDRULE
      

      Is it possible for DBCP to better handle this Oracle specific scenario?

      [1] http://www.tomee-openejb.979440.n4.nabble.com/Oracle-XA-with-different-credentials-fails-td4680456.html

      [2] https://community.oracle.com/tech/developers/discussion/1058320/ora-24774-why-does-xa-start-fails-for-2-txn-branches-on-same-instance

      Attachments

        Activity

          People

            rhn-support-csutherl Coty Sutherland
            rhn-support-aogburn Aaron Ogburn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: