Commit operation
A commit operation makes permanent all changes made under commitment control since the previous commit or rollback operation. The system also releases all locks related to the transaction.
The system performs the following steps when it receives a request to commit:
- The system saves the commit identification, if one is provided, for use at recovery time.
- The system writes records to the file before performing the commit operation if both of the following conditions are true:
- Records were added to a local or remote database file under commitment control.
- SEQONLY(*YES) was specified when the file was opened so that blocked I/O feedback is used by the system and a partial block of records exists.
Otherwise, the I/O feedback area and I/O buffers are not changed.
- The system makes a call to the commit and rollback exit program for each API commitment resource that is present in the commitment definition. If a location has more than one exit program registered, the system calls exit programs for that location in the order that they were registered.
- If any record changes were made to resources assigned to a journal, the system writes a C CM journal entry to every local journal associated with the commitment definition. Sequence of journal entries under commitment control shows the entries that are typically written while a commitment definition is active.
- The system makes permanent object-level changes that are pending.
- The system unlocks record and object locks that were acquired and kept for commitment control purposes. Those resources are made available to other users.
- The system changes information in the commitment definition to show that the current transaction has been ended.
The system must perform all of the previous steps correctly for the commit operation to be successful.
Parent topic:
How commit and rollback operations work
Related concepts
Commitment definition
Sequence of journal entries under commitment control