[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Session recovery on rollback

adrian@jboss.org do-not-reply at jboss.com
Fri Jul 14 12:09:58 EDT 2006


You are still confusing different things.
The JMS Session is not the same as the transaction.

In fact, with transaction interleaving it is perfectly legal
(and more efficient) to do the following which JBossMQ actually supports:

1) Enlist session in tx1
2) receive message 1 (this is in the session, but actually belongs to tx1)
3) delist session
4) Enlist session in tx2
5) receive message 2 (into tx2)
6) commit tx1 (this does NOT commit the session, it commits the transaction, i.e. message 1)

Again, there is a test for this in the JBossMQ testsuite.

Similarly, these could be different sessions on different threads
receiving from the same queue.

The idea of the JIRA task is that step 5 would not receive message 2
until step 6 either commits or rollbacks message 1. If it rolls back
then step 5 gets message 1.

This maintains a GLOBAL ordering across transactions/threads/sessions,
something that is not a spec requirement, but some people have
asked for.
I wouldn't recomend somebody uses this, unless they aren't worried
about throughput. :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958136#3958136

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958136



More information about the jboss-dev-forums mailing list