You can embed queue-access statements in a unit of work so that all your changes to the queues are committed or rolled back at a single processing point. If a statement is in a unit of work, the following is true:
When queue-access statements are not in a unit of work, each change to a message queue is committed immediately.
An MQSeries-related EGL add or get next statement is embedded in a unit of work if the property includeMsgInTransaction is in effect for the MQ record. The generated code includes these options:
If you do not specify the property includeMsgInTransaction for an MQ record, the queue-access statements run outside of a unit of work. The generated code includes these options:
When your code ends a unit of work, EGL commits or rolls back all recoverable resources being accessed by your program, including databases, message queues, and recoverable files. This outcome occurs whether you use the system functions (sysLib.commit, sysLib.rollback) or the EGL calls to MQSeries (MQCMIT, MQBACK); the appropriate EGL system function is invoked in either case.
A rollback occurs if an EGL program terminates early because of an error detected by EGL run-time services.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.