In some instances a commit or rollback operation is initiated by the system for a commitment definition. These types of commit and rollback operations are known as implicit commit and rollback requests.
Typically, a commit or rollback operation is initiated from an application program using one of the available programming languages that supports commitment control. These types of commit and rollback operations are known as explicit commit and rollback requests.
The following two tables show what the system does when certain events occur related to a commitment definition that has pending changes. A commitment definition has pending changes if any of the following conditions is true:
The C CM (commit operation) journal entry and C RB (rollback operation) journal entry indicate whether the operation was explicit or implicit.
The following table shows the actions the system takes when a job ends, either normally or abnormally, based on the following situations:
State | Last agent API | Action if Endjob1 option | Commit or rollback operation |
---|---|---|---|
RST | N/A | N/A | If the commitment definition is not associated with an X/Open global
transaction, an implicit rollback is performed. If the commitment definition is associated with an X/Open global transaction, the following events occur:
|
PIP | N/A | N/A | If the commitment definition is not associated with an X/Open global
transaction, an implicit rollback is performed. If the commitment definition is associated with an X/Open global transaction, the transaction branch is in the Idle (S2) state, and it is left in the Idle (S2) state. |
PRP | N/A | WAIT | If the commitment definition is not associated with an X/Open2 global
transaction, the following occurs:
|
PRP | N/A | C | If the commitment definition is not associated with an X/Open2 global transaction, an implicit commit operation is performed. |
R | If the commitment definition is not associated with an X/Open global
transaction, an implicit rollback operation is performed. If the commitment definition is associated with an X/Open global transaction, the following occurs:
|
||
CIP | N/A | N/A | An explicit commit operation is performed. |
LAP | NO | WAIT | 1. Resynchronization to the last agent is used to retrieve the decision to commit or to roll back. |
2. The returned decision to commit or to roll back is performed. It is considered an explicit operation. | |||
LAP | YES | WAIT | 1. The last agent API is called to retrieve the commit or rollback decision. |
2. The commit or rollback operation is performed. It is considered an explicit operation. | |||
LAP | N/A | C | An implicit commit operation is performed. |
R | An implicit rollback operation is performed. | ||
CMT | N/A | N/A | A commit operation has already completed for this commitment definition and any downstream locations. The commit operation is complete. |
VRO | N/A | N/A | The local and remote agents voted to read-only. All downstream agents must also have voted to read-only. No action is required. |
RBR | N/A | N/A | A rollback operation is required. An explicit rollback operation is performed. |
Note:
1 You can change the Action if Endjob option with the Change Commitment Options (QTNCHGCO) API. 2If the commitment definition is associated with an X/Open global transaction, the following events occur:
|
The following table shows the actions the system takes when an activation group ends and applies only to transactions with job-scoped locks. The system actions are based on the following items:
State | Last agent API | Type of end | Commit or rollback operation |
---|---|---|---|
RST | No | Normal | An implicit commit operation is performed. If protected conversations exist, the commitment definition will become the root initiator of the commit operation. |
RST | No | Abnormal | An implicit rollback is performed. |
RST | Yes | Normal | The API exit program is called. The commit or rollback operation is determined by the API. |
RST | Yes | Abnormal | The API exit program is called. The commit or rollback operation is determined by the API. |