Atomikos Forum |
|
Is it possible to have multiple XAResources / XAConnections pointing to the same database, or feeding from the same XADataSource?
I tried, but the transaction manager will not accept a second XAResource object that was taken from the same XADatasource, because it says I must delist before re-enlisting.
There isn't much of a stack trace to be honest:
java.lang.IllegalStateException: The given XAResource instance is being enlisted a second time without delist in between? at com.atomikos.icatch.jta.TransactionImp.enlistResource(TransactionImp.java:357) at XAClass.main(XAClass.java:93) Where XAClass is my own class calling it. The context is pretty simple, the code is like this: create an XADataSource and connect Get two XAConnections from this Datasource, and then get XAResources from those connections. Create transaction Attempt to enlist both XAConnections, but it throws this error when it reaches the second. They are two individual XAConnections, different IDs, but all I can think of is they come from the same datasource. |