You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by bizcenter <bi...@gmail.com> on 2013/05/27 10:50:46 UTC

activemq transaction

Forgive my poor english.

In JMS transaction, messages sent will be persisted( stored in db) before
session.commit() is fired?

Assume that the session.commit() failed, then the broker is stopped :
        1. where are messages sent?
        2. The broker starts in the future, if i can do session.commit()
operation?


Thansk!





--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-transaction-tp4667500.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re:activemq transaction

Posted by SuoNayi <su...@163.com>.
The situation will be complicated if you're using the failover transport.
Your commit on the session can be failed in the following cases:
1.The commit command is failed to send to the broker because the
connection between your client and broker is broken and timeout  for 
reconnection process happens .You will receive a exception indicating
failover is of timeout.You can continue to retry to commit the transaction
and you can success once the connection is re-established.
The client can track the outgoing transaction and it's messages .
No matter whether your broker is restarted or not, messages of that
transaction will be replayed when the connection is re-established.
If your broker is not restarted and has disabled message audit 
you may see duplicated messages.
2. The commit command is successful to send to the broker but the client
fails to get response from the broker because the connection between 
the client and broker is broken.Once the connection is re-established
you will receive a TransactionRollbackException indicating that the client
can not determine the commit of the transaction is successful or not.
You cannot commit that transaction anymore and you can start a new
transaction to resend the messages.
If your broker is not restarted those messages of the failed transaction
will just stand in memory and can not be released except session/connection 
is closed.


Thanks for clarification if my supposition is wrong.



At 2013-05-27 16:50:46,bizcenter <bi...@gmail.com> wrote:
>Forgive my poor english.
>
>In JMS transaction, messages sent will be persisted( stored in db) before
>session.commit() is fired?
>
>Assume that the session.commit() failed, then the broker is stopped :
>        1. where are messages sent?
>        2. The broker starts in the future, if i can do session.commit()
>operation?
>
>
>Thansk!
>
>
>
>
>
>--
>View this message in context: http://activemq.2283324.n4.nabble.com/activemq-transaction-tp4667500.html
>Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Re:activemq transaction

Posted by bizcenter <bi...@gmail.com>.
Thanks, I got it.

There is a MemoryTransactionStore will hold all messages.



--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-transaction-tp4667500p4667521.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re:activemq transaction

Posted by SuoNayi <su...@163.com>.
No,pending messages will be held in memory before the transaction is committed.
If your commit on session is failed and the broker is restarted, pending messages will be lost 
and you can issue commit on the session anymore.




At 2013-05-27 16:50:46,bizcenter <bi...@gmail.com> wrote:
>Forgive my poor english.
>
>In JMS transaction, messages sent will be persisted( stored in db) before
>session.commit() is fired?
>
>Assume that the session.commit() failed, then the broker is stopped :
>        1. where are messages sent?
>        2. The broker starts in the future, if i can do session.commit()
>operation?
>
>
>Thansk!
>
>
>
>
>
>--
>View this message in context: http://activemq.2283324.n4.nabble.com/activemq-transaction-tp4667500.html
>Sent from the ActiveMQ - User mailing list archive at Nabble.com.