Tuesday, October 20, 2015

ORA-24756: transaction does not exist

Here is the stacktrace:

java.sql.SQLException: 
ORA-24756: transaction does not exist at 
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450) at 
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:392) at 
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:385) at 
oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:1018) at 
oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522) at 
oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257) at 
oracle.jdbc.driver.T4CTTIOtxen.doOTXEN(T4CTTIOtxen.java:166) at 
oracle.jdbc.driver.T4CXAResource.doTransaction(T4CXAResource.java:757) at 
oracle.jdbc.driver.T4CXAResource.doPrepare(T4CXAResource.java:518) at 
oracle.jdbc.xa.client.OracleXAResource.prepare(OracleXAResource.java:713)


If you get this error, you must be using Oracle RAC and XA.

You must carefully craft the various timeouts in WebLogic and in Oracle DB.

See Oracle note "Troubleshooting ORA-24756 while Running an XA Program or MSDTC with the Oracle RDBMS (Doc ID 1076242.6)". THE rule is: global transaction timeout < session timeout < distributed_lock_timeout . See also "Recommended Timeout Configuration When Using an External Transaction Processing Monitor and XA with Oracle (Doc ID 338880.1)" .

Each MDB has a specific timeout, but this should not be involved in the issue (this in the weblogic.ejb.jar.xml DD https://docs.oracle.com/cd/E13222_01/wls/docs103/ejb/DDreference-ejb-jar.html )

<transaction-descriptor>
 <trans-timeout-seconds>2400</trans-timeout-seconds>
 </transaction-descriptor>


So you should end up with this configuration in config.xml and the "$XA_DATASOURCE"jdbc.xml

> config/jdbc/<datasource>-jdbc.xml
 <jdbc-xa-params>
 <keep-xa-conn-till-tx-complete>true</keep-xa-conn-till-tx-complete>
 <xa-end-only-once>true</xa-end-only-once>
 <xa-set-transaction-timeout>true</xa-set-transaction-timeout>
 <xa-transaction-timeout>3300</xa-transaction-timeout>
 <xa-retry-duration-seconds>3600</xa-retry-duration-seconds>
 </jdbc-xa-params>

> config/config.xml
 <jta>
 <timeout-seconds>3000</timeout-seconds>
 <forget-heuristics>false</forget-heuristics>
 <max-resource-requests-on-server>1000</max-resource-requests-on-server>
 </jta>




No comments: