This section describes how to use commitment control to process file operations
as a group. With commitment control, you ensure one of two outcomes for the
file operations:
all of the file operations are successful (a commit operation)
none of the file operations has any effect (a rollback operation).
In this way, you process a group of operations as a unit.
To use commitment control, you do the following:
On the i5/OS system:
Prepare for using commitment control:. Use the CL commands CRTJRN (Create
Journal), CRTJRNRCV (Create Journal Receiver) and STRJRNPF (Start Journal
Physical File).
Notify the i5/OS system when to start and end commitment control: Use
the CL commands STRCMTCTL (Start Commitment Control) and ENDCMTCTL (End Commitment
Control). For information on these commands, see the CL
and APIs section of the Programming category
in the i5/OS Information Center at this Web site - http://www.ibm.com/systems/i/infocenter/.
In the RPG program:
Specify commitment control (COMMIT) on the file-description specifications
of the files you want under commitment control.
Use the COMMIT (commit) operation code to apply a group of changes to
files under commitment control, or use the ROLBK (Roll Back) operation code
to eliminate the pending group of changes to files under commitment control.
For information on how the rollback function is performed by the system, refer
to the Recovering your system manual.
Note:
Commitment control applies only to database files.