Search code examples
javatransactionsjmswebspherejta

Transactions in IBM WebSphere


I want to use transaction in my webapp that runs on IBM WAS 7. I've got 2 databases and JMS (mq), and it will be great to rollback them all together. What the best practice to do that? Should I need to use 3d party JTA libs (like spring.tx or JOTM) or WebSphere already has this stuff inside? May be I dont need JTA at all? And can I use WAS transactions without Spring or EJB? Just ibm libs that WAS already include.


Solution

  • You can use JTA Transaction for the purpose you describe.

    Websphere supports 2-phase commit transactions which seems to be the case for you.

    However you need to create an XA Datasource for each of the Databases in order to have a Global Transaction that will handle Database and JMS Resources.