Atomikos Forum

Cannot Resume XA Transaction

I am a beginner and student.

I am using

Hibernate 3.3.1.GA
Spring 2.5.5
AtomikosTransactionsEssentials-3.3.5
Mysql Connector/J 5.1.6
Mysql 5.0

I have declared using Spring AOP transactions for all methods for all my Manager methods. These Manager methods call the DAO to save or load objects. Some managers use other manager methods too.

I get the following Exception (complete exception is pasted at the end)

com.atomikos.datasource.ResourceException: resume for XID 192.168.0.4.tm0030500292192.168.0.4.tm306 raised -5: invalid arguments were given for the XA operation

I know that MYSQL doesn't support XAResource.TMRESUME, but MY QUESTIONS ARE AS FOLLOWS.

1) is it okay to declare all methods in Managers transactional ?
2) If so, if One manager calls methods in another manager (Transaction within a transaction), how is the XA transaction handled ?
3) What is the case in the application (Atomikos) to use RESUME. (ie) In what case atomikos calls com.atomikos.datasource.xa.XAResourceTransaction.resume() method.
4) Or I am totally wrong  about all the XA stuff ?

MYSQL is my only option here and I want to figure out a way to avoid this condition somehow.

Exception.

com.atomikos.datasource.ResourceException: resume for XID 192.168.0.4.tm0030500292192.168.0.4.tm306 raised -5: invalid arguments were given for the XA operation
at com.atomikos.datasource.xa.XAResourceTransaction.resume(Unknown Source)
at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(Unknown Source)
at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(Unknown Source)
at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(Unknown Source)
at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(Unknown Source)
at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(Unknown Source)
at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(Unknown Source)
at $Proxy1.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
at org.hibernate.loader.Loader.doQuery(Loader.java:696)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2228)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
at org.hibernate.loader.Loader.list(Loader.java:2120)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
at org.springframework.orm.hibernate3.HibernateTemplate$36.doInHibernate(HibernateTemplate.java:1061)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.findByCriteria(HibernateTemplate.java:1051)
at org.springframework.orm.hibernate3.HibernateTemplate.findByCriteria(HibernateTemplate.java:1044)
reets Send private email
Tuesday, October 07, 2008
 
 
Just an update

Everything works perfectly fine when I used spring-2.5.1 instead of the latest spring release.(I didn't change a letter in the code or configuration).

So what do you think the problem might be ?. Down the road we need to update all my spring jar files. Is it an issue with Spring Framework ?.

Let me know.
reets Send private email
Wednesday, October 08, 2008
 
 
another update

the above exception occurs from spring-2.5.4 onwards. Spring-2.5.3 works fine without any code or configuration change.

I am new to all these stuff and tomorrow I am planning to get the spring source and debug myself why this happens only for spring-2.5.4.

Here is the changelog http://sourceforge.net/project/shownotes.php?release_id=595476&group_id=73357

meanwhile if someone get to know anything please let me know.

There where 2 changes in Spring transaction package (from changelog)

Package org.springframework.transaction
* TransactionSynchronizationManager automatically unwraps InfrastructureProxy objects for raw key comparisons
* AbstractFallbackTransactionAttributeSource uses concurrent Map for attribute cache in order to avoid lock contention

Thanks
reets Send private email
Wednesday, October 08, 2008
 
 
Hi,

If you mail us the tm.out file in DEBUG mode then we can look at the details.

tnx
Guy Pardon Send private email
Wednesday, October 08, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics