Atomikos Forum |
|
I have a very simple app which does this :
open an xa tx insert into db enqueue in mule (with activemq underneath) update db that i successfuly enqueued close the xa tx What i observe from the logs is : first db update goes thro fine enqueue also goes thro fine (of course it doesn't reflect in the ActiveMQ web UI) second db update also goes thro fine but ..... just before the function returns (kicking off spring's tx close part) I get this : [org.mule.impl.DefaultExceptionStrategy]- Caught exception in Exception Strategy: Session's XAResource has not been enlisted in a distributed transaction. javax.jms.JMSException: Session's XAResource has not been enlisted in a distributed transaction. at org.apache.activemq.ActiveMQXASession.doStartTransaction(ActiveMQXASession.java:109) Unsure why this is happening when the xa tx actually has committed the DB tx. If the exception occured should'nt the Db tx rollback ? Probably not because MuleClient caches the msg which goes thro fine and another thread (the MuleDispatcher thread ?) actually picks this up and this is causing the exception ??? Either way not sure why my config is not working. Would appreciate if anyone could provide some pointers. Also I have configured my Spring’s Hibernate sessionFactory to support an XA tx. Hopefully this is correct ??? -Vivek
This ActiveMQ exception is clear:
javax.jms.JMSException: Session's XAResource has not been enlisted in a distributed transaction. it says that you're sending messages outside of an XA transaction's context. You should concentrate on your transaction demarcations, mainly when they are started and when they are committed. I also wonder how you're sending your JMS messages. Could you please describe that ?
I'm sending JMS messages using the API 'MuleClient.dispatch().
I have a helper class that calls this API and I am trying to wrap the method (which calls 'client.receive()') in that class within a transaction. Somehow the Transaction maanger I have defined is not being used by mule. I have posted my configuration in Nabble forum at 'http://www.nabble.com/XA-Transaction-with-Spring%2C-Mule%2BActiveMQ%2C-Hibernate%2BMySql-and-Atomikos-to19110826.html'. Please suggest a different way to post the configuration if you are not able to open this link. Please let me know if I am doing something wrong here. Thanks again, Vivek |