1. AdroitLogic
  2. ultraesb
  3. Issues
Issue #32 resolved

IllegalTransactionStateException when calling rollback/commit after resuming transaction

Matthew Clark
created an issue

Affects latest 2.0.0-SNAPSHOT build from trunk

Using sample 506 and the special header

 routing: xadmin;server1;community#1.0##

When the rollbackTransaction() method is called in the jmsToService proxy, the following is seen in the logs and the JMS message is not actually rolled back at all

2012-11-16 12:44:15,268 [-] [primary-4]  WARN jmsToService-outSequence Quote price : 58.825844169171134 - order rejected
2012-11-16 12:44:15,268 [-] [primary-4] DEBUG SpringPlatformTransactionManager Rollback transaction
2012-11-16 12:44:15,269 [-] [primary-4] DEBUG MessageImpl Message ID : 76ada9e9-642c-45f6-9f85-16efd862f1b0 has completed processing under : jmsToService-outSequence Pending completion by : [[jmsToService]]
2012-11-16 12:44:15,269 [-] [primary-4] DEBUG jmsToService-outSequence Finished executing sequence : jmsToService-outSequence
2012-11-16 12:44:15,290 [-] [primary-4]  WARN jmsToService Sequence : jmsToService-outSequence encountered an exception : Transaction is already completed - do not call commit or rollback more than once per transaction for message with ID : 76ada9e9-642c-45f6-9f85-16efd862f1b0 - that was not handled
org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:817)
    at org.adroitlogic.ultraesb.core.spring.SpringPlatformTransactionManager.rollback(SpringPlatformTransactionManager.java:73)
    at org.adroitlogic.ultraesb.core.MessageImpl.rollbackTransaction(MessageImpl.java:1355)
    at jmsToService_outSequence.execute(jmsToService_outSequence.java from JavaSource:20)
    at org.adroitlogic.ultraesb.core.Sequence.execute(Sequence.java:314)
    at org.adroitlogic.ultraesb.core.ProxyService.processFlow(ProxyService.java:403)
    at org.adroitlogic.ultraesb.core.ProxyService.doRealWork(ProxyService.java:365)
    at org.adroitlogic.ultraesb.core.work.SimpleQueueWorkManager.doRealWork(SimpleQueueWorkManager.java:308)
    at org.adroitlogic.ultraesb.core.work.SimpleQueueWorkManager.access$000(SimpleQueueWorkManager.java:55)
    at org.adroitlogic.ultraesb.core.work.SimpleQueueWorkManager$1.run(SimpleQueueWorkManager.java:254)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
2012-11-16 12:44:15,290 [-] [primary-4] DEBUG MessageImpl Message ID : 76ada9e9-642c-45f6-9f85-16efd862f1b0 has completed processing under : jmsToService Pending completion by : [[]]

Comments (2)

  1. Asankha Perera

    Tested 1.7.1 GA release, starting sample 506 via command line (bin$ ./ultraesb.sh -sample 506) and tested with the ToolBox, and this worked correctly.

    2012-11-19 10:38:14,962 [-] [primary-1] INFO jmsToService-inSequence Processing queued message from JMS.. 2012-11-19 10:38:15,017 [-] [primary-3] WARN jmsToService-outSequence Quote price : 87.84715438696047 - order rejected 2012-11-19 10:38:15,023 [-] [primary-1] INFO jmsToService-inSequence Processing queued message from JMS.. 2012-11-19 10:38:15,038 [-] [primary-4] WARN jmsToService-outSequence Quote price : 75.91284304390717 - order rejected 2012-11-19 10:38:15,041 [-] [primary-1] INFO jmsToService-inSequence Processing queued message from JMS.. 2012-11-19 10:38:15,046 [-] [primary-5] INFO jmsToService-outSequence Confirm order at : 168.5341111131345

    With current trunk I suspect the transaction does not suspend and hence the error. I am also seeing the following message which I am investigating

    2012-11-19 10:43:06,953 [-] [primary-6] WARN SpringMessageListenerContainer Setup of JMS message listener invoker failed for destination 'Q.jmsPending' - trying to recover. Cause: No value for key [org.apache.activemq.spring.ActiveMQConnectionFactory@40f12b72] bound to thread [primary-6]

  2. Log in to comment