WebSphere MQ, building your application, unit of work, commitment control" /> Interfaces to the i5/OS external syncpoint manager

 

Interfaces to the i5/OS external syncpoint manager

WebSphere MQ for iSeries uses native i5/OS commitment control as an external syncpoint coordinator. See the AS/400 Programming: Backup and Recovery Guide Guide for more information about the commitment control capabilities of i5/OS.

To start the i5/OS commitment control facilities, use the STRCMTCTL system command. To end commitment control, use the ENDCMTCTL system command.

Note:
The default value of Commitment definition scope is *ACTGRP. This must be defined as *JOB for WebSphere MQ for iSeries. For example:

STRCMTCTL LCKLVL(*ALL) CMTSCOPE(*JOB)

If you call MQPUT, MQPUT1, or MQGET, specifying PMSYP or GMSYP, after starting commitment control, WebSphere MQ for iSeries adds itself as an API commitment resource to the commitment definition. This is typically the first such call in a job. While there are any API commitment resources registered under a particular commitment definition, we cannot end commitment control for that definition.

WebSphere MQ for iSeries removes its registration as an API commitment resource when you disconnect from the queue manager, provided there are no pending MQI operations in the current unit of work.

If you disconnect from the queue manager while there are pending MQPUT, MQPUT1, or MQGET operations in the current unit of work ,WebSphere MQ for iSeries remains registered as an API commitment resource so that it is notified of the next commit or rollback. When the next syncpoint is reached, WebSphere MQ commits or rolls back the changes as required. It is possible for an application to disconnect and reconnect to a queue manager during an active unit of work and perform further MQGET and MQPUT operations inside the same unit of work (this is a pending disconnect).

If you attempt to issue an ENDCMTCTL system command for that commitment definition, message

CPF8355 is issued, indicating that pending changes were active. This message also appears in the job log when the job ends. To avoid this, ensure that you commit or roll back all pending WebSphere MQ operations, and that you disconnect from the queue manager. Thus, using COMMIT or ROLLBACK commands before ENDCMTCTL should enable end-commitment control to complete successfully.

When OS/400 commitment control is used as an external syncpoint coordinator, MQCMIT, MQBACK, and MQBEGIN calls may not be issued. Calls to these functions fail with the reason code MQRC_ENVIRONMENT_ERROR.

To commit or roll back (that is, to back out) your unit of work, use one of the programming languages that supports the commitment control. For example:

  • CL commands: COMMIT and ROLLBACK

  • ILE C Programming Functions: _Rcommit and _Rrollback

  • RPG/400: COMMIT and ROLBK

  • COBOL/400: COMMIT and ROLLBACK