OpenTP1 Version 7 Programming Reference COBOL Language

[Contents][Index][Back][Next]

CBLDCMCF('COMMIT ') - Commit an MHP

Format

PROCEDURE DIVISION specification

CALL  'CBLDCMCF'  USING  unique-name-1

DATA DIVISION specification

01  unique-name-1.
   02  data-name-A    PIC X(8) VALUE 'COMMIT  '.
   02  data-name-B    PIC X(5).
   02  FILLER        PIC X(3).
   02  data-name-C    PIC X(16).

Description

CBLDCMCF('COMMIT ') notifies the UAP at the transaction branch as a root transaction branch making up the transaction, the transaction service, and the resource manager that the global transaction initiated by the MHP has terminated processing normally (the global transaction has been committed).

When the CBLDCMCF('COMMIT ') returns normally, a new global transaction is started.

If a global transaction consists of multiple transaction branches (it involves programs other than the MHP which called this CBLDCMCF('COMMIT ')), the entire global transaction will not be committed until each transaction branch is committed. If the global transaction is composed of multiple resource managers, it will not be committed until the results of each resource manager's processing are committed. If the global transaction is not committed, all the transaction branches are rolled back and the program returns with an error, giving the status code of 70906.

CBLDCMCF('COMMIT ') can be used only by an MHP specified as nonresponse type (type=noans) in the MCF application definition. If it is used by an MHP of another type, it returns with an error, giving the status code of 72000. If it is called by a UAP other than an MHP, it also returns with an error, giving the status code of 72000.

Data areas whose values are set in the UAP

data-name-A

Specify VALUE 'COMMIT[Figure]' as the request code indicating MHP commitment.

data-name-C

Specify LOW-VALUE.

Data area to which a value is returned from OpenTP1

data-name-B

A status code of 5 digits is returned.

Status codes

Status code Explanation
00000 Normal termination. If this status code returns, the process which called CBLDCMCF('COMMIT ') has started a new transaction.
70906 The transaction was not committed, but was rolled back. If this status code returns, the process which called CBLDCMCF('COMMIT ') has started a new transaction.
70907 The global transaction which called CBLDCMCF('COMMIT ') was subjected to a heuristic decision which brought about the following:
Some transaction branches were committed, whereas other transaction branches were rolled back. If this status code returns, the process which called CBLDCMCF('COMMIT ') has started a new transaction.
70908 The transaction branch of the global transaction was completed heuristically. However, the synchronization point of the heuristically completed transaction branch cannot be identified because of an error. If this status code returns, the process which called CBLDCMCF('COMMIT ') has started a new transaction.
The status code 00904 will also be returned if 00000001 is assigned to the trn_extend_function operand in the transaction service definition and if the resource manager returns XAER_NOTA after a one-phase commit.
72000 Return at MHP execution:
The MHP called CBLDCMCF('COMMIT ') before CBLDCMCF('RECEIVE ') for receiving the first segment.
CBLDCMCF('COMMIT ') was called by an MHP which is not nonresponse type (type=noans).
CBLDCMCF('COMMIT ') was called by an MHP with the nontransaction attribute.
Return at SPP execution:
CBLDCMCF('COMMIT ') cannot be called by SPPs.
72028 The value specified for data-name-A is invalid.
Others than the above An unprecedented error (e.g., program damage) occurred.

Notes

Even when CBLDCMCF('COMMIT ') returns normally, the input message is not deleted from the input queue. This means that when message processing is restarted after the MHP is rescheduled, the already committed range (up to what point the results of processing have been committed) is unknown. The MHP is rescheduled when:

If message processing is to be continued by the rescheduled MHP, the user is responsible for learning the committed range of processing results.