[jboss-user] [JBoss Messaging] - Re: XA transaction
timfox
do-not-reply at jboss.com
Fri Jul 6 13:39:04 EDT 2007
Yes, that would be expected behaviour.
You have a transaction in which you are doing two things:
1) persisting something to your database
2) sending a jms message
When the transaction commits, the two XAResources corresponding to the database and the jms system will first have prepare called on them by the transaction manager, then they will have commit called on them.
The *order* in which each XAResource is called is up to the transaction manager and not specified in the JTA spec.
So, if the commit gets called on the database XAResource *before* commit is called on the JMS XAresource there is a chance the message is sent and received before the entity is persisted in the database.
You should design your system not to rely on implementation details of the transaction manager which may vary from transaction manager to transaction manager and from time to time.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061413#4061413
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061413
More information about the jboss-user
mailing list