The first time you use an EGL statement with a WebSphere® MQ record during a program, EGL checks to see if there is an active connection to a queue manager. If not, it creates one.
After you have read from or written to a message queue you may need to commit or roll back your changes.
You can connect to only one queue manager at a time in an EGL program.
EGL automatically connects to the queue manager on the first add or get next statement in a program, using the queue manager name specified in the system resource name associated with the message queue record. If the queue manager name is not specified, the queue manager is the default queue manager defined for your system. EGL automatically disconnects from the queue manager when the program ends, closing any open files and committing the current unit of work if it is still open.
For more information on MQCONN and MQDISC, see Using direct WebSphere MQ API calls. In workstation environments (Windows NT®, OS/2®, AIX®, Solaris, and HP), WebSphere MQ provides different runtime libraries for WebSphere MQ programs depending on whether the program is running on the same system as the message queue manager or whether the program is running as an WebSphere MQ client communicating with a manager on a server system. On AIX and HP systems, different libraries are provided for threaded and non-threaded environments as well.
EGL saves the connection handle for future add statements.
EGL automatically closes the connection to the queue on program termination.
EGL automatically closes the connection to the queue on program termination.
When you combine messages in a transaction that defines a unit of work, the messages can be committed or rolled back as a group. When a unit of work is committed, everything included in the transaction is finalized. When a unit of work is rolled back, everything included in the transaction is removed.
In these transaction environments, message queue commits and rollbacks are coordinated with commits and rollbacks for other recoverable resources, like DB2® databases, using a two-phase commit protocol.
In other environments, the resources for different managers are committed independently from one another. EGL automatically issues the appropriate WebSphere MQ calls for commits and rollbacks when you use sysLib.commit() and sysLib.rollback().