« Return to Thread: Getting "bitronix.tm.internal.BitronixXAException: resource already started on XID" error
Hi Eric,Thanks for using Bitronix. I'm sure Ludovic will be responding soon regarding this issue, butif you're willing to test the BTM-2.2 development branch, I would be interested to see if thisissue has been fixed.With BTM-2.2 we're moving from a Java 1.4 codebase to Java 5. And in the processconverting the code to use type-safe collections and more importantly taking advantage ofthe newer Java 5 concurrent collections and synchronization primitives. While goingthrough this process, I found at least one theoretical race condition, though not one thathad yet been reported.I've been running the BTM-2.2 codebase on our pre-production servers for the pasttwo months, and have run several tens of millions of transactions through withoutissue. Admittedly, we do not have multiple datasources and are not using LRC, soyour environment is definitely different.So, if you want to try the snapshot and give me your feedback regarding this issueor whether any other errors occur in your testing. I've made a snapshot available here:Regards,BrettOn Sat, Dec 10, 2011 at 12:32 AM, Eric Westfall <ewestfal@...> wrote:Hello, we're having an issue that I'm hoping someone on this list may know something about.
We have an application configured which uses two different databases. It's using the transaction management support provided by the spring framework configured for JTA. Things seems to work well most of the time, but when we run load tests against it we get errors similar to the following occasionally:
* bitronix.tm.internal.BitronixXAException: resource already started on XID a Bitronix XID [737072696E672D62746D0000013423394EA100000E41 : 737072696E672D62746D0000013423394F0100000E4F]
at bitronix.tm.resource.jdbc.lrc.LrcXAResource.start(LrcXAResource.java:135)
at bitronix.tm.internal.XAResourceHolderState.start(XAResourceHolderState.java:219)
at bitronix.tm.internal.XAResourceManager.enlist(XAResourceManager.java:111)
at bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:93)
at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:70)
at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:84)
at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:289)
at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
...
Full stack trace here: http://www.pastie.org/2991516
Any ideas on why this might be happening? It appears that somehow a resource which is "started" is getting reused across multiple concurrent transactions which seems like it shouldn't happen.
Here is our bitronix transaction manager configuration:
bitronix.tm.serverId=spring-btm
bitronix.tm.disableJmx=true
bitronix.tm.timer.defaultTransactionTimeout=3600
bitronix.tm.journal=null
bitronix.tm.timer.gracefulShutdownInterval=0
bitronix.tm.journal.disk.logPart1Filename=target/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=target/btm2.tlog
bitronix.tm.2pc.warnAboutZeroResourceTransactions=false
bitronix.tm.allowMultipleLrc=true
bitronix.tm.setIgnoreRecoveryFailures=true
Of particular note here, we are using the "LRC" setup with two datasources which is why we have allowMultipleLrc=true
Relevant PoolingDataSource configuration from our spring configuration is as follows:
<property name="useTmJoin" value="true" />
<property name="allowLocalTransactions" value="true" />
<property name="shareTransactionConnections" value="true" />
<property name="enableJdbc4ConnectionTest" value="true" />
<property name="automaticEnlistingEnabled" value="true"/>
Thanks in advance for any help!
Eric
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
« Return to Thread: Getting "bitronix.tm.internal.BitronixXAException: resource already started on XID" error
| Free embeddable forum powered by Nabble | Forum Help |