Notes
Recommended coding practices: An explicit COMMIT
or ROLLBACK statement should be coded at the end of an application process.
Either an implicit commit or rollback operation will be performed at the end
of an application process depending on the application environment. Thus,
a portable application should explicitly execute a COMMIT or ROLLBACK before
execution ends in those environments where explicit COMMIT or ROLLBACK is
permitted.
An implicit COMMIT or ROLLBACK may be performed under the following circumstances.
- For the default activation group:
- An implicit COMMIT is not performed when applications that run in the
default activation group end. Interactive SQL, Query Manager, and non-ILE
programs are examples of programs that run in the default activation group.
- In order to commit work, you must issue a COMMIT.
- For non-default activation groups when the scope of the commitment definition
is to the activation group:
- If the activation group ends normally, the commitment definition is implicitly
committed.
- If the activation group ends abnormally, the commitment definition is
implicitly rolled back.
- Regardless of the type of activation group, if the scope of the commitment
definition is the job, an implicit commit is never performed.
Effect of commit: Commit without HOLD causes the
following to occur:
Row lock limit: A unit of work can include the processing
of up to 4 million rows, including rows retrieved during a SELECT or FETCH
statement61, and rows inserted, deleted, or updated as part
of INSERT, DELETE, and UPDATE statements.62
Unaffected statements: The commit and rollback operations
do not affect the DROP SCHEMA statement, and this statement is not, therefore,
allowed in an application program that also specifies COMMIT(*CHG), COMMIT(*CS),
COMMIT(*ALL), or COMMIT(*RR).
Commitment definition use: The commitment
definition used by SQL is determined as follows:
- If the activation group of the program calling SQL is already using an
activation group level commitment definition, then SQL uses that commitment
definition.
- If the activation group of the program calling SQL is using the job level
commitment definition, then SQL uses the job level commitment definition.
- If the activation group of the program calling SQL is not currently using
a commitment definition but the job commitment definition is started, then
SQL uses the job commitment definition.
- If the activation group of the program calling SQL is not currently using
a commitment definition and the job commitment definition is not started,
then SQL implicitly starts a commitment definition. SQL uses the Start Commitment
Control (STRCMTCTL) command with:
- A CMTSCOPE(*ACTGRP) parameter
- A LCKLVL parameter based on the COMMIT option specified on either the
CRTSQLxxx, STRSQL, or RUNSQLSTM commands. In REXX, the LCKLVL parameter is
based on the commit option in the SET OPTION statement.
This limit also includes:
- Any rows accessed or changed through files opened under commitment control
through high-level language file processing
- Any rows deleted, updated, or inserted as a result of a trigger or CASCADE,
SET NULL, or SET DEFAULT referential integrity delete rule.
Unless you specified COMMIT(*CHG) or COMMIT(*CS),
in which case these rows are not included in this total.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.