OpenTP1 Version 7 Programming Reference C Language

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

dc_mcf_commit - Commit an MHP

Format

ANSI C, C++

#include <dcmcf.h>
int  dc_mcf_commit(DCLONG action)

K&R C

#include <dcmcf.h>
int  dc_mcf_commit (action)
DCLONG      action;

Description

The function dc_mcf_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 function dc_mcf_commit() terminates normally, a new global transaction is generated.

If a global transaction consists of multiple transaction branches [it involves programs other than the MHP which called the function dc_mcf_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 function returns with an error, giving the return value DCMCFRTN_ROLLBACK.

The function dc_mcf_commit() can be called only by an MHP specified as nonresponse-type (type=noans) in the MCF application definition. If it is called by an MHP of another type, it returns with an error, giving the return value DCMCFRTN_72000. If it is called by a UAP other than an MHP, it also returns with an error, giving the return value DCMCFRTN_72000.

Arguments whose value is set in the UAP

action

Specify DCNOFLAGS.

Return values

Return value Return value (numeric) Explanation
DCMCFRTN_00000 0 Normal termination. If this return value returns, the process which called the function dc_mcf_commit() has started a new transaction.
DCMCFRTN_ROLLBACK -11906 The transaction was not committed, but was rolled back. If this return value returns, the process which called the function dc_mcf_commit() has started a new transaction.
DCMCFRTN_HEURISTIC -11907 The global transaction which called the function dc_mcf_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 return value returns, the process which called the function dc_mcf_commit() has started a new transaction.
DCMCFRTN_HAZARD -11908 The transaction branch of the global transaction was completed heuristically. However, the synchronization point of the heuristically completed transaction branch cannot be identified. If this return value returns, the process which called the function dc_mcf_commit() has started a new transaction.
This function returns DCMCFRTN_HAZARD even when you specify 00000001 for the trn_extend_function operand in the transaction service definition and the return value from the resource manager at one-phase commit is XAER_NOTA.
DCMCFRTN_72000 -13000

If the function returns at MHP execution:
The function dc_mcf_commit() was called at a wrong position. The MHP called the function dc_mcf_commit() before the function dc_mcf_receive() for receiving the first segment.
The function dc_mcf_commit() was called by an MHP which is not specified as nonresponse-type (type=noans) in the MCF application definition.
The function dc_mcf_commit() was called by an MHP with the nontransaction attribute.

If the function returns at SPP execution:
The function dc_mcf_commit() cannot be called by SPPs.
DCMCFRTN_72016 -13016 The value specified for action is invalid.
Other than the above An unprecedented error (e.g., program damage) occurred.

Notes

Even when the function dc_mcf_commit() terminates 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:

  1. An MCF event is reported to schedule an MHP for MCF event processing.
  2. Since the system is terminated abnormally, the OpenTP1 reschedules the MHP for the process.

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