3 Replies Latest reply: Nov 30, 2010 4:15 AM by Nigeldeakin-Oracle RSS

    Switched to XA transactions and seeing BrokerExceptions I don't understand

    809569
      Hi,
      I'm using OpenMQ (4.3) as my JMS provider for a J2SE application.
      I've been using it for quite some time and recently I encountered the need to have XA Transactions enabled.
      I did the relevant changes in the application code, using Atomikos EssentialTransactions as my Transaction Manager, and I suddenly started seeing a strange, and somewhat unclear, BrokerException in the logs of my broker.
      I should point out that for the past year or so I haven't encountered any problems with OpenMQ but I have also been using the very basic and mainstream features.
      Excerpt of the broker logs:
      ERROR com.sun.messaging.jmq.jmsserver.util.BrokerException: Bad transaction state transition. Cannot perform operation END_TRANSACTION(58) (XAFlag=0x2000000:TMSUSPEND) on a transaction in state PREPARED(5).: TUID=**** Xid=****:
      com.sun.messaging.jmq.jmsserver.util.BrokerException: Bad transaction state transition. Cannot perform operation END_TRANSACTION(58) (XAFlag=0x2000000:TMSUSPEND) on a transaction in state PREPARED(5).
      at com.sun.messaging.jmq.jmsserver.data.TransactionState.nextState(TransactionState.java:440)
      at com.sun.messaging.jmq.jmsserver.data.handlers.TransactionHandler.doEnd(TransactionHandler.java:2010)
      at com.sun.messaging.jmq.jmsserver.data.handlers.TransactionHandler.handle(TransactionHandler.java:540)
      at com.sun.messaging.jmq.jmsserver.data.PacketRouter.handleMessage(PacketRouter.java:181)
      at com.sun.messaging.jmq.jmsserver.service.imq.IMQIPConnection.readData(IMQIPConnection.java:1489)
      at com.sun.messaging.jmq.jmsserver.service.imq.IMQIPConnection.process(IMQIPConnection.java:644)
      at com.sun.messaging.jmq.jmsserver.service.imq.OperationRunnable.process(OperationRunnable.java:170)
      at com.sun.messaging.jmq.jmsserver.util.pool.BasicRunnable.run(BasicRunnable.java:493)
      at java.lang.Thread.run(Unknown Source)

      Has anyone encountered this issue?
      I'm not sure why OpenMQ says it cannot end a transaction which is in Prepared state?
      Maybe the issue is that somehow the Transaction Manager is telling OpenMQ to close the transaction without committing/rollbacking first?

      I'd appreciate any leads,
      Ittai