Previous Topic: RETURN (DC/UCF)Next Topic: SEND MESSAGE (DC/UCF)


ROLLBACK

The ROLLBACK statement rolls back uncommitted changes made to the database through an individual run unit or through all database sessions associated with a task. A task-level rollback also backs out all uncommitted changes made in conjunction with scratch, queue, and print activity.

Whether the changes are automatically backed out depends on the execution environment:

If CONTINUE is not specified, run units (and SQL sessions) impacted by the ROLLBACK statement end, and their access to the database is terminated. If CONTINUE is specified, impacted database sessions remain active after the operation is complete.

The ROLLBACK statement is used in both the navigational and logical record facility environments. The ROLLBACK TASK statement is also used in an SQL programming environment.

Currency

Following a ROLLBACK statement, all currencies are set to null. Unless the CONTINUE option is specified, the issuing program or task cannot perform database access through an impacted run unit without executing another BIND/READY sequence.

Syntax
►►─── ROLLBACK ─┬────────┬─┬──────────────┬─ ; ───────────────────────────────►◄
                └─ TASK ─┘ └─ (CONTINUE) ─┘
Parameters
TASK

Rolls back the uncommitted changes made by all scratch, queue, and print activity and all top-level run units associated with the current task and terminates those run units. Its impact on SQL sessions associated with the task depends on whether those sessions are suspended and whether their transactions are eligible to be shared.

More information:

For more information about the impact of a ROLLBACK TASK statement on SQL sessions, see the CA IDMS SQL Programming Guide.

For more information about run units and the impact of ROLLBACK TASK, see the CA IDMS Navigational DML Programming Guide.

CONTINUE

Central version only. Causes the affected run units and SQL sessions to remain active after their changes are backed out. Database access can be resumed without reissuing BIND and READY statements.

Note: The CONTINUE option should not be used in local mode if database changes have been made.

Example

The following statement reverses the effects of the run unit through which it is issued and terminates the run unit:

ROLLBACK;
Status Codes

Upon completion of the ROLLBACK function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:

0000

The request has been serviced successfully.

1958

CONTINUE was specified and database changes could not be backed out. The run unit has been terminated.

5031

The specified request is invalid; the program may contain a logic error.

5058

TASK CONTINUE was specified and database changes could not be backed out.

5097

An error was encountered processing a syncpoint request; check the log for details.