commit()

The sysLib.commit() system function saves updates to recoverable resources such as certain files and databases.

In most cases, EGL performs a single-phase commit that affects each recoverable manager in turn. In most cases, this commit releases the read position and the update locks in all files or databases. For information about when an implicit commit takes place, see Logical unit of work. You can enhance performance by avoiding unnecessary use of sysLib.commit(). For more information, see "Compatibility" in this topic. Also see discussions about segmentation for various UI technologies in the related reference links at the end of this topic.

Syntax

  sysLib.commit( )

Compatibility

Table 1. Compatibility considerations for commit()
Platform Issue
Java™ generation
  • sysLib.commit() commits changes to relational databases and WebSphere® MQ message queues, as well as changes made to remote server programs that were called using a client-controlled unit of work.
CICS® for z/OS®
  • sysLib.commit() results in a CICS SYNCPOINT, which performs a two-phase commit that is coordinated across all resource managers.
  • When a call to a remote COBOL program involves a client-controlled unit of work, a generated Java program or wrapper also saves the updates done by a remote, CICS-based COBOL program (including updates to CICS recoverable files). For more information, refer to the EGL Generation Guide information on luwControl.
  • Remotely called batch programs (programs that reside on a different system than the invoking program) can invoke sysLib.commit(). If you set the luwControl attribute to SERVER, the commit functions normally. If you set the attribute to CLIENT, EGL throws a RuntimeException.
  • Depending on the CICS file definition and file type, a file can be a recoverable resource.
COBOL generation When you use the cursorWithHold option during relational database access (SQL), the read position and the update locks might not be released; for more information, see open considerations for SQL and prepare considerations for SQL.
IMS™ BMP
  • For a transaction-oriented BMP, sysLib.commit() is ignored. For more information on when an implicit commit occurs, see Logical unit of work.
  • For a batch-oriented BMP, sysLib.commit() results in a DL/I basic CHKP call, which performs a two-phase commit that is coordinated across all resource managers. The contents of psbData.psbName are used as the checkpoint identifier on the CHKP call.
  • Output written to a serial file associated with a non-express alternate PCB is recoverable.
  • GSAM files are not recoverable when used with basic CHKP. To make GSAM files recoverable, use one of the following system functions to issue a DL/I symbolic checkpoint call:
    • dliLib.AIBTDLI()
    • dliLib.EIBTDLI()
    • vgLib.VGTDLI()
IMS/VS sysLib.commit is ignored in this environment. For details on when an implicit commit occurs, see Logical unit of work.
iSeries® COBOL If the program issued SQL statements, sysLib.commit() results in an SQL COMMIT WORK. If the program has not issued SQL requests, sysLib.commit() results in the equivalent of an iSeries COMMIT command. For details on when an implicit commit occurs, see Logical unit of work
JavaScript generation sysLib.commit is not supported.
WebSphere MQ message queues
  • Message queue updates are recoverable only if the includeMsgInTransaction property is set to YES in the MQRecord part.
  • Both message get and add statements are affected by commit() and rollback() for recoverable messages. If you issue a rollback() 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 you issue a rollback() following an add for a recoverable message, the message is deleted from the queue.
z/OS batch
  • If the program has not specified a PSB but has issued SQL requests, invoking sysLib.commit() results in an SQL COMMIT WORK.
  • If the program has specified a PSB, invoking sysLib.commit() results in a DL/I basic CHKP call, which performs a two-phase commit that is coordinated across all resource managers. The contents of psbData.psbName are used as the checkpoint identifier on the CHKP call.
  • GSAM files are not recoverable when used with basic CHKP. To make GSAM files recoverable, use one of the following system functions to issue a DL/I symbolic checkpoint call:
    • dliLib.AIBTDLI()
    • dliLib.EIBTDLI()
    • vgLib.VGTDLI()

Feedback