Atomikos Forum |
|
Hi, I am using UTX to manage transaction in my client code. I am creating a IBM MQXAQueueConnectionFactory object dynamically in the code and wrapping it in AtomikosConnectionFactoryBean. I am getting :
09-13 08:44:34] WARN atomikos [main]: ERROR IN RECOVERY com.atomikos.datasource.ResourceException: Error in getting XA resource . . 09-13 08:44:35] WARN atomikos [main]: Could not create an XASession on the javax.jms.XAConnectionFactory's XAConnection - check if your JMS backend is configured for XA? javax.jms.JMSException: MQJMS1068: failed to obtain XAResource . . -------------------------------------------------- My code fragments are: factory = new AtomikosConnectionFactoryBean(); factory.setXaConnectionFactory ( queueConnectionFactory ); factory.setUniqueResourceName ( queueName + "My_MQSeries_XA_RMI" ); . . utx.begin(); queueConnection = factory.createConnection(); queue = queueSession.createQueue(queueName); queueReceiver = ((QueueSession)queueSession).createReceiver(queue); queueConnection.start(); . If I change the 'queueConnection ='''' statement to : queueConnection = factory.getXaConnectionFactory().createXAConnection(); it retreives the first message off the queue but then when I do 'utx.commit();' later on, I am getting: javax.transaction.RollbackException: Transaction set to rollback only Table lock problems.... at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:312) at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:612) at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:168) at XASynchQueueReceiver.main(XASynchQueueReceiver.java:202) What am I doing wrong? Thanks for any tips.
forgot to also mention that I am initializing session as:
queueSession = queueConnection.createSession(true, 0); And ignore the message 'Table lock problems'.. (that has no relevance to this issue) - no db access is being done.. it is just a placeholder message for later on
forgot to also mention that I am initializing session as:
queueSession = queueConnection.createSession(true, 0); And ignore the message 'Table lock problems'.. (that has no relevance to this issue) - no db access is being done.. it is just a placeholder message for later on
forgot to also mention that I am initializing session as:
queueSession = queueConnection.createSession(true, 0); And ignore the message 'Table lock problems'.. (that has no relevance to this issue) - no db access is being done.. it is just a placeholder message for later on
forgot to also mention that I am initializing session as:
queueSession = queueConnection.createSession(true, 0); And ignore the message 'Table lock problems'.. (that has no relevance to this issue) - no db access is being done.. it is just a placeholder message for later on
I have resolved this now. There was a single queue and another program was also reading from the queue in a non-XA and non-txn mode. Don't know how that might have impacted my code but then I had a second dedicated queue created exclusively for my testing and my code works just fine. No issues so far.
Seems like the jms message keeps rolling back despite there is a utx.commit();
These are the messages in the console: [09-13 12:12:42] WARN atomikos [main]: Local heuristic termination of coordinator atomikos.tm0000100054 with state COMMITTING [09-13 12:12:42] WARN atomikos [main]: Local heuristic termination of coordinator atomikos.tm0000100054 with state COMMITTING Seems to me that the tm 'atomikos.tm' is terminating before COMMIT is complete.. Any explanations?
Seems like the jms message keeps rolling back despite there is a utx.commit();
These are the messages in the console: [09-13 12:12:42] WARN atomikos [main]: Local heuristic termination of coordinator atomikos.tm0000100054 with state COMMITTING [09-13 12:12:42] WARN atomikos [main]: Local heuristic termination of coordinator atomikos.tm0000100054 with state COMMITTING Seems to me that the tm 'atomikos.tm' is terminating before COMMIT is complete.. Any explanations? |