Websphere MQ transactions
Websphere MQ can send and receive messages as part of a transaction or outside a transaction. If a message is sent or received as part of a transaction, the transaction can include other resource such as DB2® operations.
Websphere MQ can serve as the transaction manager itself or participate as a resource manager to other transaction managers (such as CICS®, Encina, and Tuxedo). Detailed information on transactions and supported external transaction managers can be found in the Websphere MQSeries® Information Center.
ENDCMTCTL
STRCMTCTL LCKLVL(*CHG) CMTSCOPE(*JOB)
- Enter the following source in a source file member JOBSCOPE in
MJASRC/CL:
PGM ENDCMTCTL STRCMTCTL LCKLVL(*CHG) CMTSCOPE(*JOB) ENDPGM
- Create the CL program using the following default MQ message queue
manager:
CRTCLPGM PGM(MJATST/JOBSCOPE) SRCFILE(MJASRC/CL)
- Create the SQL external procedure that references the CL program:
CREATE PROCEDURE MJATST.START_JOB_LEVEL_COMMIT () EXTERNAL NAME 'MJATST/JOBSCOPE' PARAMETER STYLE GENERAL
CALL MJATST.START_JOB_LEVEL_COMMIT;
INSERT INTO MJATST.T1
VALUES(1);
VALUES MQSEND('A commit test message');
COMMMIT;
INSERT INTO MJATST.T1
VALUES(2);
VALUES MQSEND('A rollback test message');
ROLLBACK;
Websphere MQ can send and receive messages as part of a transaction or outside a transaction. In a DB2 MQ function this is controlled by the specified policy. Each policy has a SYNCPOINT attribute. If the SYNCPOINT column for a policy has a value of 'N', any DB2 MQ function that uses that policy will not participate in a transaction. If the SYNCPOINT column for a policy has a value of 'Y', any DB2 MQ function that uses that policy and changes the input queue will participate in a transaction.