Upgrading to the final Oracle JDBC driver results in a SQLException: Unexpected exception while invoking XAConnection

When updating the thin Oracle JDBC driver in SQLException: Unexpected exception while enlisting XAConnection(WebLogic Server version 10.0, oracle version) we get the error indicated below.

We have followed Oracle recommendations

  • change global timeout in weblogic i.e. for JDBC connection pools, set the values XASetTransactionTimeoutto trueand XATransactionTimeoutequal to zero. When this parameter is set to zero, the XAResource session timeout will be set to the global transaction timeout. Therefore, the time on the WLS must be changed.
  • If the problem persists, it can be avoided by installing KeepXAConnTillTxComplete="true".

    Database Product Version: Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production with Partition Separation, OLAP and Oracle Data Jing Server Version 9.2.0.5.0 - Production
    JDBC Driver Name: Oracle
    JDBC Driver JDBC Driver Version: 11.1.0.7 .0-Production

We know that one option is not to use the XA connection, but in our case this is not so. We need to use XA connections.

java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_PROTO start() failed on resource 'serviceDataSource': XAER_PROTO : Routine was invoked in an inproper context
oracle.jdbc.xa.OracleXAException
        at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1101)
        at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:237)
        at weblogic.jdbc.wrapper.VendorXAResource.start(VendorXAResource.java:50)
        at weblogic.jdbc.jta.DataSource.start(DataSource.java:696)
        at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1183)
        at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1116)
        at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:275)
        at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:508)
        at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:435)
        at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1407)
        at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1331)
        at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:426)
        at weblogic.jdbc.jta.DataSource.connect(DataSource.java:383)
        at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:339)
+3
source share
1 answer

After such consultation from Oracle, we decided to update the driver to the latest available driver. This seems to have solved the problem.

0
source

Source: https://habr.com/ru/post/1762351/


All Articles