rollback()

The sysLib.rollback() system function reverses updates that were made to recoverable resources since the last commit.

The reversal occurs in all EGL-generated applications.

If a program ends because of an error, a rollback occurs automatically.

Syntax

  sysLib.rollback( )

Compatibility

Table 1. Compatibility considerations for rollback()
Platform Issue
CICS® for z/OS®
  • sysLib.rollback() results in a CICS SYNCPOINT ROLLBACK, which rolls back changes to relational databases, WebSphere® MQ message queues, and files defined as recoverable resources.
  • When a call to a remote, CICS-based COBOL program involves a client-controlled unit of work, a generated Java™ program or wrapper also reverses the updates done by a remote COBOL program (including updates to CICS recoverable files) . For more information, see luwControl in callLink element.
  • Remotely called batch programs (programs that reside on a different system than the invoking program) can invoke sysLib.rollback(). If you set the luwControl attribute to SERVER, the commit functions normally. If you set the attribute to CLIENT, EGL throws a RuntimeException.

sysLib.rollback() rolls back spool files.

IMS™ BMP sysLib.rollback() results in a DL/I ROLB call. The output that is written to the serial file associated with a non-express alternate PCB is also backed out.
IMS/VS sysLib.rollback() results in a DL/I ROLB call. Output written to serial file associated with a non-express alternate PCB is also backed out.
Java generation
  • sysLib.rollback() reverses changes to the following resources:
    • relational databases
    • WebSphere MQ message queues
    • remote server programs that were called using a client-controlled unit of work.
  • Do not call sysLib.rollback() from a generated Java program that you invoked through an Enterprise JavaBean (EJB). EJBs cannot touch the transaction in which they run.
JavaScript generation sysLib.rollback() 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 sysLib.commit() and sysLib.rollback() for recoverable messages. If a sysLib.rollback() is issued after 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 sysLib.rollback() is issued after an add for a recoverable message, the message is deleted from the queue.
z/OS batch
  • If the program runs under the TSO terminal monitor program for SQL access and you invoke sysLib.rollback(), an SQL ROLLBACK WORK statement results.
  • If the program runs as a DL/I batch job, and you have made DL/I or SQL requests, a DL/I ROLB call is issued. When the batch job starts, you must specify the IMS batch parameter BKO=Y to ensure that the ROLB call is honored. If you specify BKO=N, DL/I returns status code AL for the ROLB call. The program treats AL as a soft error and does not issue an error message. Specify BKO as a parameter in the job step that calls the IMS control program DFSRRC00.
  • Serial or print files that are associated with GSAM files and the use of sysLib.audit() result in DL/I requests and cause the DL/I ROLB call to be issued.
  • EGL programs that do not use DL/I issue a rollback only if the program has made changes to an SQL table. A rollback does not occur for changes to an SQL table made by a non-EGL (or non-VisualAge Generator) program.

Feedback