[activemq-user] How does ActiveMQ support local transactions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[activemq-user] How does ActiveMQ support local transactions

Sandeep Kadam-2
I am sending a message on the queue and have set the ackMode as 2 (i.e client should explicitly acknowledge the receipt of message).
I am using Mule to send messages and Mule handles ack using transactions. When the client tries to acknowledge (i.e commit), I get the following exception:

********************************************************************************
Message          : Transaction commit failed
Type             : org.mule.transaction.IllegalTransactionStateException
Code             : 91397
JavaDoc          : http://mule.codehaus.org/docs/apidocs/org/mule/transaction/IllegalTransactionStateException.html
********************************************************************************
Exception stack is:
1. The Session is closed (javax.jms.IllegalStateException)
  org.activemq.ActiveMQSession:557 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/IllegalStateException.html)
2. Transaction commit failed (org.mule.transaction.IllegalTransactionStateException)
  org.mule.providers.jms.JmsClientAcknowledgeTransaction:66 (http://mule.codehaus.org/docs/apidocs/org/mule/transaction/IllegalTransactionStateException.html)
********************************************************************************
Root Exception stack trace:
javax.jms.IllegalStateException: The Session is closed
        at org.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:557)
        at org.activemq.ActiveMQMessageConsumer$1.execute(ActiveMQMessageConsumer.java:400)
        at org.activemq.command.ActiveMQMessage.acknowledge(ActiveMQMessage.java:84)
        at org.mule.providers.jms.JmsClientAcknowledgeTransaction.doCommit(JmsClientAcknowledgeTransaction.java:64)
        at org.mule.transaction.AbstractTransaction.commit(AbstractTransaction.java:99)
        at org.mule.transaction.AbstractSingleResourceTransaction.commit(AbstractSingleResourceTransaction.java:59)
        at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:79)
        at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:93)
        at org.mule.providers.jms.JmsMessageReceiver.poll(JmsMessageReceiver.java:142)
        at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:74)
        at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
        at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

********************************************************************************

I am not sure how transactions work in activeMQ. Can anybody help me out with this.

Sandeep.
Reply | Threaded
Open this post in threaded view
|

Re: [activemq-user] How does ActiveMQ support local transactions

James Strachan-2
This looks like a bug in either Mule or your code - it appears that  
the JMS Session that was used to consume the message is already  
closed by the time the Message.acknowledge() message is called.

Maybe you should send this mail to the Mule user list?

James

On 24 Nov 2005, at 05:01, Sandeep Kadam wrote:

> I am sending a message on the queue and have set the ackMode as 2  
> (i.e client should explicitly acknowledge the receipt of message).
> I am using Mule to send messages and Mule handles ack using  
> transactions. When the client tries to acknowledge (i.e commit), I  
> get the following exception:
>
> **********************************************************************
> **********
> Message          : Transaction commit failed
> Type             :  
> org.mule.transaction.IllegalTransactionStateException
> Code             : 91397
> JavaDoc          : http://mule.codehaus.org/docs/apidocs/org/mule/ 
> transaction/IllegalTransactionStateException.html
> **********************************************************************
> **********
> Exception stack is:
> 1. The Session is closed (javax.jms.IllegalStateException)
>   org.activemq.ActiveMQSession:557 (http://java.sun.com/j2ee/ 
> sdk_1.3/techdocs/api/javax/jms/IllegalStateException.html)
> 2. Transaction commit failed  
> (org.mule.transaction.IllegalTransactionStateException)
>   org.mule.providers.jms.JmsClientAcknowledgeTransaction:66 (http://
> mule.codehaus.org/docs/apidocs/org/mule/transaction/
> IllegalTransactionStateException.html)
> **********************************************************************
> **********
> Root Exception stack trace:
> javax.jms.IllegalStateException: The Session is closed
> at org.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:557)
> at org.activemq.ActiveMQMessageConsumer$1.execute
> (ActiveMQMessageConsumer.java:400)
> at org.activemq.command.ActiveMQMessage.acknowledge
> (ActiveMQMessage.java:84)
> at org.mule.providers.jms.JmsClientAcknowledgeTransaction.doCommit
> (JmsClientAcknowledgeTransaction.java:64)
> at org.mule.transaction.AbstractTransaction.commit
> (AbstractTransaction.java:99)
> at org.mule.transaction.AbstractSingleResourceTransaction.commit
> (AbstractSingleResourceTransaction.java:59)
> at org.mule.transaction.TransactionTemplate.execute
> (TransactionTemplate.java:79)
> at org.mule.providers.TransactedPollingMessageReceiver.poll
> (TransactedPollingMessageReceiver.java:93)
> at org.mule.providers.jms.JmsMessageReceiver.poll
> (JmsMessageReceiver.java:142)
> at org.mule.providers.PollingMessageReceiver.run
> (PollingMessageReceiver.java:74)
> at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
> at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
> (Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> **********************************************************************
> **********
>
> I am not sure how transactions work in activeMQ. Can anybody help  
> me out with this.
>
> Sandeep.


James
-------
http://radio.weblogs.com/0112098/