sysLib.commit
The system function sysLib.commit saves updates that were made to databases and MQSeries message queues since the last commit. A generated Java program or wrapper also saves the updates done by a remote, CICS-based COBOL program (including updates to CICS recoverable files), but only when the call to the remote COBOL program involves a client-controlled unit of work, as described in luwControl in callLink element.
In most cases, EGL performs a single-phase commit that affects each recoverable manager in turn. On CICS for z/OS, however, sysLib.commit results in a CICS SYNCPOINT, which performs a two-phase commit that is coordinated across all resource managers.
sysLib.commit releases the scan position and the update locks in any file or databases.
When you use sysLib.commit with MQ records, the following statements apply:
- Message queue updates are recoverable only if the Include message in transaction option is selected in MQ record part.
- Both message gets and adds are affected by commit and rollback for recoverable messages. If a rollback is issued following a get for a recoverable message, the message is placed back on the input queue so that the input message is not lost when the transaction fails to complete successfully. Also, if a rollback is issued following an add for a recoverable message, the message is deleted from the queue.
You can enhance performance by avoiding unnecessary use of sysLib.commit. For details on when an implicit commit occurs, see Logical unit of work.
Example
sysLib.commit();
Related concepts
Logical unit of work
MQSeries support
Run unit
SQL support
Related reference
File and database (system words)
luwControl in callLink element
prepare
open
sysVar.commitOnConverse
sysVar.segmentedMode