Commitment control during abnormal system or job end
The system ends all commitment definitions for a job when the job ends abnormally. These commitment definitions are ended during the job end processing. This topic applies only to commitment definitions with job-scoped locks.
If the system ends abnormally, the system ends all commitment definitions that were started and being used by all active jobs at the time of the abnormal system end. These commitment definitions are ended as part of the database recovery processing that is performed during the next IPL after the abnormal system end. Attention: The recovery for commitment definitions refers to an abnormal end for the system or a job due to a power failure, a hardware failure, or a failure in the operating system or licensed internal code. You must not use the End Job Abnormal (ENDJOBABN) command to force a job to end abnormally. The abnormal end can result in pending changes for active transactions for the job you are ending to be partially committed or rolled back. The next IPL might attempt recovery for any partial transactions for the job ended with the ENDJOBABN command.
The outcome of commitment control recovery that the system performs during an IPL for a job that you end with the ENDJOBABN command is uncertain. It is because all locks for commitment resources are released when the job is ended abnormally. Any pending changes due to partial transactions are made available to other jobs. These pending changes can then cause other application programs to make additional erroneous changes to the database. Likewise, any ensuing IPL recovery that is performed later can adversely affect the changes made by applications after the job was ended abnormally. For example, an SQL table might be dropped during IPL recovery as the rollback action for a pending create table. However, other applications might have already inserted several rows into the table after the job was ended abnormally.
The system performs as follows for commitment definitions being ended during an abnormal job end or during the next IPL after an abnormal system end:
- Before ending a commitment definition, the system performs an implicit rollback operation if the commitment definition has pending changes, unless processing for the commitment definition was interrupted in the middle of a commit operation. If ended in the middle of a commit operation, the transaction might be rolled back, resynchronized, or committed, depending on its state. The processing to perform the implicit rollback operation or to complete the commit operation includes calling the API commit and rollback exit program for each API commitment resource associated with the commitment definition. After the API commit and rollback exit program is called, the system automatically removes the API commitment resource. Attention: Ending the job while a transaction is in doubt (transaction state is LAP or PRP) can cause inconsistencies in the database (changes might be committed on one or more systems and rolled back on other systems).
- If the Action if Endjob commitment option is COMMIT, changes on this system are committed if the job is ended, without regard to whether changes on the other systems participating in the transaction are committed or rolled back.
- If the Action if Endjob commitment option is ROLLBACK, changes on this system are rolled back if the job is ended, without regard to whether changes on the other systems participating in the transaction are committed or rolled back.
- If the Action if Endjob commitment option is WAIT, the job will not end until resynchronization completes to the system that owns the commit or rollback decision. To make the job end before resynchronization is complete, a heuristic decision must be made and resynchronization must be canceled.
Ending the job or system abnormally during a long-running rollback is not recommended. This causes another rollback to occur as the job ends (or during the next IPL if the system is ended). The subsequent rollback will repeat the work performed by the original rollback and take significantly longer to run.
- If a notify object is defined for the commitment definition, it might be updated.
If a process ends before commitment control is ended and protected conversations are still active, the commitment definition might be required to commit or roll back. The action is based on the State option and the Action if end job option for the commitment definition.
Parent topic:
System-initiated end of commitment control
Related concepts
Implicit commit and rollback operations
Updates to the notify object