title: Upgrading to Oracle JDBC thin driver results in SQLException: Unexpected exception while enlisting XAConnection
body: <p>In Upgrading to Oracle JDBC thin driver results in <code>SQLException: Unexpected exception while enlisting XAConnection</code> (WebLogic Server 10.0, oracle version ) we are getting the error listed below.</p>
  
  <p>We did follow Oracle's advice to</p>
  
  <ol>
  <li>change the global timeout in weblogic, i.e. For the JDBC Connection Pools set the <code>XASetTransactionTimeout</code> to <code>true</code> and <code>XATransactionTimeout</code> to zero
  When this parameter is set to zero, the XAResource Session Timeout will be set to the global transaction timeout.
  Hence the time out on the WLS needs to be modified</li>
  <li><p>If the issue still remains it can be avoided by setting <code>KeepXAConnTillTxComplete="true"</code>.</p>
  
  <p>Database Product Version : Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.5.0 - Production<br>
  JDBC Driver Name : Oracle JDBC driver<br>
  JDBC Driver Version : 11.1.0.7.0-Production </p></li>
  </ol>
  
  <p>We know one option is not to use an XA connection, but in our case that is not a possibility. We defenitly need to use XA connections.</p>
  
  <pre><code>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)
  </code></pre>