We have a requirement where we will receive some JMS messages in a queue, we will process the messages and then persist in the database. All of these operations must be executed in the transaction context. I understand this will involve the global transactions implementations. Please guide me how to achieve this using Spring framework.
Unless you really need them, then I've avoid global (XA) transactions and all the complexities of two phase commits. Its all gets very complex and systems can suffer with performance issues. Spring does offer support for global transaction management but the underling resources must support XA transactions.
Spring transaction management tries to resolve the problem of both transactions. Consistent programming model approach can be used in any environment. Same code will work for different transactions management in different environment.