Implicit commit and rollback operations

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:

  • If the transaction branch state is not Active (S1), no action is performed and the transaction branch is left in the same state.
  • If the transaction branch state is Active (S1), an implicit rollback is performed.
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:
  • Resynchronization is started to receive the decision from the initiator of the commit operation.
  • The returned decision to commit or rollback is performed. It is considered an explicit operation.
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:

  • If the job that started the transaction ends, the transaction is left in a prepared state until the XA TM either commits it or rolls it back. The XA transaction branch state will be left at Prepared (S3) in this case.
  • If the SQL server job that the transaction's work is being routed to is ended, a forced rollback is implicitly performed. The XA transaction branch state will be changed to Heuristically Completed (S5) in this case.
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:

  • If the job that started the transaction ends, the transaction is left in a prepared state until the XA TM either commits it or rolls it back. The XA transaction branch state will be left at Prepared (S3) in this case.
  • For transaction-scoped locks only, if the SQL server job that the transaction's work is being routed to is ended, a forced rollback is implicitly performed. The XA transaction branch state will be changed to Heuristically Completed (S5) in this case.

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.
Related concepts
Commitment control during abnormal system or job end
Related reference
Change Commitment Options (QTNCHGCO) API