Home

 

Usage notes

  1. Use the MQBEGIN call to start a unit of work that is coordinated by the queue manager and that might involve changes to resources owned by other resource managers. The queue manager supports three types of unit-of-work:

    • Queue-manager-coordinated local unit of work: This is a unit of work in which the queue manager is the only resource manager participating, and so the queue manager acts as the unit-of-work coordinator.

      • To start this type of unit of work, specify the MQPMO_SYNCPOINT or MQGMO_SYNCPOINT option on the first MQPUT, MQPUT1, or MQGET call in the unit of work.

        The application does not need to issue the MQBEGIN call to start the unit of work, but if MQBEGIN is used, the call completes with MQCC_WARNING and reason code MQRC_NO_EXTERNAL_PARTICIPANTS.

      • To commit or back out this type of unit of work, use the MQCMIT or MQBACK call.

    • Queue-manager-coordinated global unit of work: This is a unit of work in which the queue manager acts as the unit-of-work coordinator, both for MQ resources and for resources belonging to other resource managers. Those resource managers cooperate with the queue manager to ensure that all changes to resources in the unit of work are committed or backed out together.

      • To start this type of unit of work, use the MQBEGIN call.

      • To commit or back out this type of unit of work, use the MQCMIT and MQBACK calls.

    • Externally-coordinated global unit of work: This is a unit of work in which the queue manager is a participant, but the queue manager does not act as the unit-of-work coordinator. Instead, there is an external unit-of-work coordinator with which the queue manager cooperates.

      • To start this type of unit of work, use the relevant call provided by the external unit-of-work coordinator.

        If the MQBEGIN call is used to try to start the unit of work, the call fails with reason code MQRC_ENVIRONMENT_ERROR.

      • To commit or back out this type of unit of work, use the commit and back-out calls provided by the external unit-of-work coordinator.

        If you use the MQCMIT or MQBACK call to commit or back out the unit of work, the call fails with reason code MQRC_ENVIRONMENT_ERROR.

  2. If the application ends with uncommitted changes in a unit of work, the disposition of those changes depends on whether the application ends normally or abnormally. See the usage notes in MQDISC - Disconnect queue manager for further details.

  3. An application can participate in only one unit of work at a time. The MQBEGIN call fails with reason code MQRC_UOW_IN_PROGRESS if there is already a unit of work in existence for the application, regardless of which type of unit of work it is.

  4. The MQBEGIN call is not valid in an MQ client environment. An attempt to use the call fails with reason code MQRC_ENVIRONMENT_ERROR.

  5. When the queue manager is acting as the unit-of-work coordinator for global units of work, the resource managers that can participate in the unit of work are defined in the queue manager's configuration file.

  6. On i5/OS, the three types of unit of work are supported as follows:

    • Queue-manager-coordinated local unit of work can be used only when a commitment definition does not exist at the job level, that is, the

      STRCMTCTL command with the CMTSCOPE(*JOB) parameter must not have been issued for the job.

    • Queue-manager-coordinated global unit of work is not supported.

    • Externally-coordinated global unit of work can be used only when a commitment definition exists at job level, that is, the

      STRCMTCTL command with the CMTSCOPE(*JOB) parameter must have been issued for the job. If this has been done, the i5/OS

      COMMIT and ROLLBACK operations apply to MQ resources as well as to resources belonging to other participating resource managers.



 

Home