Sometimes the order of commits is important. This mostly happens if you have the following use case:
Now participant no. 1 will be committed before participant no. 2, which means that there’s a race condition between when process B consumes the message and when the database transaction has completed.
Use separate jms connection factories for receive/send: this will give 3 participants, and a commit order (for the participants in the XA transaction) as: (1)jms-receive (2) db (3) jms-send.