9.4.1.2.1 Selecting Criteria for a Successful Commit
When more than one group is involved in a transaction, you can specify which of two criteria must be met for tpcommit()
to return successfully:
- When all participants have indicated a readiness to commit (that is, when all participants have reported that phase 1 of the two-phase commit has been logged as complete and the coordinating TMS has written its decision to commit to stable storage)
- When all participants have finished phase 2 of the two-phase commit
To specify one of these prerequisites, set the CMTRET
parameter in the RESOURCES
section of the configuration file to one of the following values:
-
LOGGED
—to require completion of phase 1 -
COMPLETE
—to require completion of phase 2
By default, CMTRET
is set to COMPLETE
.
If you later want to override the setting in the configuration file, you can do so by calling the tpscmt()
function with its flags
argument set to either TP_CMT_LOGGED
or TP_CMT_COMPLETE
.
Parent topic: Two-phase Commit Protocol