Logical unit of work
When you change non-recoverable resources, such as serial files on Windows™ 2000, that change is relatively permanent; neither your code nor EGL runtime services can rescind the changes without notice. When you change recoverable resources, such as databases, your code or EGL runtime services can either commit the changes to make them permanent or roll back the changes to return to content that was in effect the last time changes were committed.
- Relational databases
- CICS® queues and files that are configured to be recoverable
- DL/I databases and GSAM files (in some cases)
- WebSphere® MQ message queues, unless your MQ record specifies otherwise
- Output that is directed to alternate PCBs; alternate PCBs are available when the target system is IMS™ BMP or IMS/VS
- Your code invokes the sysLib.commit() or sysLib.rollback() system functions to commit or roll back the changes.
- EGL runtime services performs a rollback in response to a hard error that is not handled in your code; in this case, all the programs in the run unit are removed from memory.
- An implicit commit occurs, as in the following cases:
- A run unit ends successfully; see Run unit.
- A program issues a show statement.
- A program issues a transfer to transaction statement,
with the following distinctions:
- In a program that runs under CICS® or IMS/VS, the transfer always causes a commit.
- In other programs, the transfer causes a commit only if the value of the synchOnTrxTransfer build descriptor option is YES.
- A Text UI program issues a converse statement when the program is acting as a segmented program.
If the program runs in a transactional environment (CICS®, IMS™, or iSeries®), EGL issues an environment commit that performs a two-phase commit coordinated across all resource managers and across all programs in the run unit. In non-transactional environments, EGL performs a single phase commit that calls each recoverable resource manager separately.
- To enable this capability, use the ELACPIOP sample JCL to generate
a new version of ELARPIOP. The ELACPIOP sample JCL is the ELAJCL dataset
that is created during the customization of the IBM® Rational® COBOL
Runtime for zSeries product. You have two choices:
- Repeat the installation customization that is specified in section 6.2.1.2.2 of the Program Directory; or
- Modify the ELACPIOP JCL by adding the RRSAF=Y parameter, as shown
here:
ELARMIOP NLS=ENU,EOF=N,SCFOLD=Y,IMSESA=N,SEGMSG=N, X MSGTRN=ELAE,TRBUF=64,TSQUE=32,RRSAF=Y
- The following files must be changed to enable the usage of RRSAF:
- The JCL or EGL Build scripts that are used to precompile your program; and
- The execution JCL that is used to run the batch job.
Additional details are in the DB2® RRSAF documentation.
- The EGL support described earlier is only for implicit RRSAF database
connections. If you are using explicit database connections when
running code under RRSAF, you need to update your EGL program.
Additional details are in the DB2® RRSAF documentation.
- If an EGL program calls a non-EGL program and both programs access SQL tables, you must close all cursors before the call if the non-EGL program causes a commit or rollback.
- In non-transactional environments, if any of the EGL programs in a run unit does not perform SQL, but calls or transfers to a non-EGL program that does SQL I/O, then EGL does not issue a commit at the end of the run unit.
Compatibility
| Platform | Issue |
|---|---|
| Java™ generation |
|
| CICS® | In a CICS® run
unit, only one DB2® UDB database
is available at a time; automatic processing occurs in the following
manner:
A commit occurs in the following cases, which are related
to DL/I processing:
|
| IMS™ BMP | sysLib.commit() is
ignored for transaction-oriented BMP programs in which the program
uses a get next statement to read a serial
file that is associated with the I/O PCB. For these programs, the
system performs the commit in any of the following conditions:
GSAM files are not recoverable when used with basic CHKP. To make GSAM files recoverable, use dliLib.AIBTDLI(), dliLib.EGLTDLI(), or vgLib.VGTDLI() for symbolic checkpoint instead of sysLib.commit(). |
| IMS/VS | sysLib.commit() is
ignored. Commit processing only occurs at the following implicit commit
points:
In relation to the logical unit
of work, an explicit checkpoint command (CHXP) causes a get unique
(GU) call to the I/O PCB, which in turn causes a commit. The following
warnings apply:
|
| iSeries® COBOL | An implicit commit is issued in the following
situations:
If the program has issued SQL requests, invoking a sysLib.commit() results in an SQL COMMIT WORK statement. If the program has not issued SQL requests, invoking a sysLib.commit() results in the equivalent of an iSeries® COMMIT command. |
| z/OS® batch | If the program does not specify a PSB but has issued SQL requests, invoking sysLib.commit() results in an SQL COMMIT WORK statement. If the program has a PSB specified, invoking sysLib.commit() results in a DL/I basic CHKP call, which commits changes to all databases. The contents of the dliLib.psbData.psbName structure act as the checkpoint identifier on the CHKP call. GSAM files are not recoverable when used with basic CHKP. To make GSAM files recoverable, use dliLib.AIBTDLI(), dliLib.EGLTDLI(), or vgLib.VGTDLI() for symbolic checkpoint instead of sysLib.commit(). |