Atomikos Forum

XA: raised -5: invalid arguments were given for the XA operation

I have an application that works fine using Spring-2.0.8, Hibernate-3.5.2GA, Atomikos-3.5.2 and mysql-connector-5.1.6. I am trying to upgrade the Spring framework to version 2.56 as it has some features that I would like (Flex-BlazeDS integration) but I am finding that I am getting the following when I try to write to the database (I am unsure if it also happens on read). I have tried upgrading Spring and mysql-connector and will try Hibernate and Atomikos next but does anyone have any suggestions?

Thanks for any replies.

09-11-04 24:23:35,997 [main] XADBMSProsoc: refreshed XAResource
09-11-04 24:24:04,025 [main] XADBMSProsocForum: refreshed XAResource
09-11-04 24:24:13,289 [main] XADBMSProsocBlog: refreshed XAResource
09-11-04 24:24:21,247 [main] XADBMSProsocCMSMagnoliaPublic: refreshed XAResource
09-11-04 24:24:28,296 [main] XADBMSProsocCMSMagnoliaAuthor: refreshed XAResource
09-11-04 24:26:27,692 [http-8443-5] XA resource 'XADBMSProsoc': resume for XID '636F6D2E61746F6D696B6F732E737072696E672E6A6462632E746D30303030323030303137:636F6D2E61746F6D696B6F732E737072696E672E6A6462632E746D32' raised -5: invalid arguments were given for the XA operation
com.mysql.jdbc.jdbc2.optional.MysqlXAException: XAER_INVAL: Invalid arguments (or unsupported command)
    at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.mapXAExceptionFromSQLException(MysqlXAConnection.java:602)
    at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.dispatchCommand(MysqlXAConnection.java:585)
    at com.mysql.jdbc.jdbc2.optional.MysqlXAConnection.start(MysqlXAConnection.java:525)
    at com.atomikos.datasource.xa.XAResourceTransaction.resume(XAResourceTransaction.java:643)
    at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(BranchEnlistedStateHandler.java:32)
    at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:41)
    at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:60)
    at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:151)
    at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:164)
    at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:104)
    at $Proxy8.prepareStatement(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225)
    at $Proxy7.prepareStatement(Unknown Source)
Gavin DOnald Send private email
Wednesday, November 04, 2009
 
 
Maybe I am hitting this problem as the error message is identical:

http://www.atomikos.com/Documentation/KnownProblems#MySQL_XA_bug

If so I don't understand why it worked previously to the Spring upgrade.
Gavin DOnald Send private email
Wednesday, November 04, 2009
 
 
The only solution I could come up with was to use a non-XA datasource configuration. I have reported this as an issue with the Spring Issue tracker at:

http://jira.springframework.org/browse/SPR-6405

as it seems to be a change within Spring that cause the problem. I am not sure who this problem really resides with though as Spring may now simply be doing things correctly where previously it was allowing something to happen that shouldn't.

A non-XA datasource looks like this (in case you are unsure):

<bean id="dataSource" class="com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean" init-method="init" destroy-method="close">
        <property name="uniqueResourceName"><value>NonXADBMS</value></property>
        <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
        <property name="url"><value>jdbc:mysql://localhost:3306/YOUR_DATABASE_HERE?autoReconnect=true</value></property>
        <property name="user"><value>USERNAME</value></property>
        <property name="password"><value>PASSWORD</value></property>
        <property name="minPoolSize"><value>1</value></property>
    </bean>
Gavin DOnald Send private email
Monday, November 23, 2009
 
 

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

Other recent topics Other recent topics