When you change non-recoverable resources, 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.
A
logical unit of work identifies input operations that
are either committed or rolled back as a group. A unit of work begins
when your code changes a recoverable resource and ends when the first
of the following events occurs:
- Your code invokes the SysLib.commit or SysLib.rollback 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 units.”
EGL
performs a single phase commit that calls each recoverable resource
manager separately.
The following considerations apply to the interaction of EGL and
non-EGL programs.
- 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.
- 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.