This topic has been discussed several times before. Basically, the commit order when a row is inserted into the database and a JMS message notifying interested listeners of that fact. Given that JTA does not dictate the commit order, the MDB might get the message first without the row being comitted in the database. This is a serious shotcoming yet a very common pattern that we all use.
Most answers in the forum suggest not having to depend on the transaction manager implementation. However, no suggestions is given on how to work around this issue.
In our implementation, we must be getting lucky because we do not see the problem. Just because we do not see it, it does not mean it is not there. Are we getting lucky because our code is somehow enlisting the DB Datasource before JMSXA? Is the JMS layer enlisting itself "last" in the resource list?
Does anyone have a suggestion or a pattern on how to get around this issue without major "reinventing the wheel" or adding a delivery delay to the MDB? We have a requirement of the message being processed as soon as a record is inserted in the database.
We are migrating away from the combination of JBOSSMQ and ActiveMQ to JBOSS messaging and it truly has been great working with this product. Thank you very much.