Commitment Definitions and Activation Groups
Commitment Definitions and Activation Groups
Commitment Definitions and Activation Groups
Multiple commitment definitions can be started and used by programs running within a job. Each commitment definition for a job identifies a separate transaction that has resources associated with it. These resources can be committed or rolled back independently of all other commitment definitions started for the job.
Note: Only ILE programs can start commitment control for activation groups other than a default activation group. Therefore, a job can use multiple commitment definitions only if the job is running one or more ILE programs.
Original program model (OPM) programs run in the single-level storage default activation group. By default, OPM programs use the *DFTACTGRP commitment definition. For OPM programs, you can use the *JOB commitment definition by specifying CMTSCOPE(*JOB) on the STRCMTCTL command.
When you use the Start Commitment Control (STRCMTCTL) command, you specify the scope for a commitment definition on the commitment scope (CMTSCOPE) parameter. The scope for a commitment definition indicates which programs that run within the job use that commitment definition. The default scope for a commitment definition is to the activation group of the program issuing the STRCMTCTL command. Only programs that run within that activation group will use that commitment definition, except that the default activation groups share one commitment definition. Commitment definitions that are scoped to an activation group are referred to as commitment definitions at the activation group level. The commitment definition started at the activation group level for a default activation group is known as the default activation group (*DFTACTGRP) commitment definition. Commitment definitions for many activation group levels can be started and used by programs that run within various activation groups for a job.
A commitment definition can also be scoped to the job. A commitment definition with this scope value is referred to as the job-level or *JOB commitment definition. Any program running in an activation group that does not have a commitment definition started at the activation group level uses the job-level commitment definition. This occurs if the job-level commitment definition has already been started by another program for the job. Only a single job-level commitment definition can be started for a job.
For a given activation group, only a single commitment definition can be used by the programs that run within that activation group. Programs that run within an activation group can use the commitment definition at either the job level or the activation group level. However, they cannot use both commitment definitions at the same time.
When a program performs a commitment control operation, the program does not directly indicate which commitment definition to use for the request. Instead, the system determines which commitment definition to use based on which activation group the requesting program is running in. This is possible because, at any point in time, the programs that run within an activation group can use only a single commitment definition.