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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...