Committing a unit of work in a JMS environment
Messages sent and received by the IBM® MQ classes for JMS in a Liberty JVM server can be associated with a CICS® unit of work (UOW). How this is done differs based on the mode used to connect to the queue manager.
When using JMS in a CICS standard-mode Liberty JVM server there is no implicit CICS task or UOW. To ensure IBM MQ updates are transactional, the application should use the Java Transaction API (JTA).
When connected in client mode in a CICS
integrated-mode Liberty JVM server, messages sent and received by the IBM MQ classes for JMS in a Liberty JVM
server can be associated with a CICS UOW. This association is
not made by default and the application must call the
UserTransaction begin()
method to establish this association before updating any IBM MQ or CICS resources. To complete a UOW, the
UserTransaction commit() or
rollback() methods should be used. The use of the commit() and
rollback() methods on the following objects to commit or roll back the UOW is not supported:Session(JMS 1.1)JmsContext(JMS 2.0)com.ibm.cics.server.Task
For more information on UserTransaction, see Java Transaction API (JTA).