ORA-24756 transaction does not exit

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ORA-24756 transaction does not exit

Gérald Quintana
Hello,

Here is the scenario, very simple:
try {
    log begin
    begin tx
    write to Oracle
    send message to SonicMQ
    commit tx
    log end
} catch (Exception ) {
    rollback tx
    log error
}

Writing to Oracle has not been done (not commited obviously)
Message sending to SonicMQ has been done (consuming application receives it)
There is 2 seconds between begin/end log and no error log (hence no rollback)
The problems occurs rarely.

Do you have an idea of what's wrong?
Gerald

Here is the log:
9 nov. 2010 12:02:46 bitronix.tm.twopc.Committer$CommitJob handleXAException
ATTENTION: resource 'jdbc/XADataSource' reported XAER_NOTA when asked
to commit transaction branch. Transaction is prepared and will commit
via recovery service when resource availability allows.
oracle.jdbc.xa.OracleXAException
        at oracle.jdbc.driver.T4CXAResource.kputxrec(T4CXAResource.java:954)
        at oracle.jdbc.driver.T4CXAResource.doCommit(T4CXAResource.java:446)
        at oracle.jdbc.xa.client.OracleXAResource.commit(OracleXAResource.java:560)
        at bitronix.tm.twopc.Committer$CommitJob.commitResource(Committer.java:175)
        at bitronix.tm.twopc.Committer$CommitJob.execute(Committer.java:164)
        at bitronix.tm.twopc.executor.Job.run(Job.java:51)
        at bitronix.tm.twopc.executor.SyncExecutor.submit(SyncExecutor.java:12)
        at bitronix.tm.twopc.AbstractPhaseEngine.runJobsForPosition(AbstractPhaseEngine.java:110)
        at bitronix.tm.twopc.AbstractPhaseEngine.executePhase(AbstractPhaseEngine.java:71)
        at bitronix.tm.twopc.Committer.commit(Committer.java:63)
        at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:216)
        at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:104)
        at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1028)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
        (...)
Caused by: java.sql.SQLException: ORA-24756: la transaction n'existe pas
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:388)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:381)
        at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:564)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
        at oracle.jdbc.driver.T4CTTIOtxen.doOTXEN(T4CTTIOtxen.java:168)
        at oracle.jdbc.driver.T4CXAResource.doTransaction(T4CXAResource.java:746)
        at oracle.jdbc.driver.T4CXAResource.doCommit(T4CXAResource.java:421)
        ... 63 more
9 nov. 2010 12:03:22 bitronix.tm.recovery.Recoverer run
INFO: recovery committed 1 dangling transaction(s) and rolled back 0
aborted transaction(s) on 2 resource(s) [jms/XAConnectionFactory,
jdbc/XADataSource] (restricted to serverId 'tomcat-btm-node-A')

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: ORA-24756 transaction does not exit

Ludovic Orban
Administrator
Apparently you've found yet another case where the Oracle JDBC driver reports an error code illegal in this context. I'm going to add some extra logic to handle it but other than reporting a correct error message (which will be something like "the transaction is completely screwed and we have no idea why") there is little to do, except trying to fix your potentially corrupted data and to find what's causing this.

What happens is that for some reason Oracle manages to loose the transaction (yes, literally loose it like in 'I had my keys in my hand 5 minutes ago and now I have no idea where they are') between prepare and commit which is strictly forbidden by the XA spec and can be considered an Oracle bug (JDBC driver or DB, it's impossible to know without access to the sources) as if something bad happened to that transaction at this time Oracle must remember what happened and inform the transaction manager with a proper error code.

Once again with so little detail it's impossible to find the root cause. One thing that could cause such problem is if you run BTM in a cluster with the exact same server ID on each node. Other than that the bug could be nearly anywhere between BTM, Oracle's JDBC driver, Oracle's database, some trigger or stored procedure you may use or what not. BTM debug logs may help troubleshooting the problem but not only I guess it would be very hard to collect them as I suspect you're getting this error message in a production environment but also you would certainly collect gigabytes of logs which would take me days to analyze with no guarantee about the result.

My advice: call Oracle and tell them to fix their driver so that it reports a proper error message.
Reply | Threaded
Open this post in threaded view
|

Re: ORA-24756 transaction does not exit

Gérald Quintana
Thanks for your diagnostic.

Gérald

2010/11/11 Ludovic Orban <[hidden email]>:

>
> Apparently you've found yet another case where the Oracle JDBC driver reports
> an error code illegal in this context. I'm going to add some extra logic to
> handle it but other than reporting a correct error message (which will be
> something like "the transaction is completely screwed and we have no idea
> why") there is little to do, except trying to fix your potentially corrupted
> data and to find what's causing this.
>
> What happens is that for some reason Oracle manages to loose the transaction
> (yes, literally loose it like in 'I had my keys in my hand 5 minutes ago and
> now I have no idea where they are') between prepare and commit which is
> strictly forbidden by the XA spec and can be considered an Oracle bug (JDBC
> driver or DB, it's impossible to know without access to the sources) as if
> something bad happened to that transaction at this time Oracle must remember
> what happened and inform the transaction manager with a proper error code.
>
> Once again with so little detail it's impossible to find the root cause. One
> thing that could cause such problem is if you run BTM in a cluster with the
> exact same server ID on each node. Other than that the bug could be nearly
> anywhere between BTM, Oracle's JDBC driver, Oracle's database, some trigger
> or stored procedure you may use or what not. BTM debug logs may help
> troubleshooting the problem but not only I guess it would be very hard to
> collect them as I suspect you're getting this error message in a production
> environment but also you would certainly collect gigabytes of logs which
> would take me days to analyze with no guarantee about the result.
>
> My advice: call Oracle and tell them to fix their driver so that it reports
> a proper error message.
> --
> View this message in context: http://old.nabble.com/ORA-24756-transaction-does-not-exit-tp30171875p30191824.html
> Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email