[jboss-user] [JBoss Messaging] - Re: Clearing up confussion

timfox do-not-reply at jboss.com
Thu Jun 12 14:46:48 EDT 2008


"ejb3workshop" wrote : Maybe I didn't explain is correctly. I am sending a message as well as persisting and entity. Since I would like to use XA, I'd expect both to succeed. For this to be the case the entity should be persisted and the message should be placed on the queue. However the message is already being received on the other end by the next bean, while the entity is not yet persisted. 
  | 

Yes, that can happen with XA even though they are both in the same tx!

This is what happens (simplified):

1. JTA tx starts to commit
2. Commit called on jms xa resource - message gets sent

3. Commit called on db xa resource - row gets stored in DB
4. JTA tx has finished committing

Now, between 2 and 3 since it takes a finite time, the message can hit the queue, get consumed, and the consumer won't find the row in the db since the original tx has not finished committing yet.



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

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



More information about the jboss-user mailing list