Previous Topic: ROLLBACK WORKNext Topic: Example


Description

ROLLBACK WORK

The ROLLBACK WORK statement is the rollback operation. The unit of recovery in which the statement is executed is terminated and a new unit of recovery is initiated. All changes made by CREATE, COMMENT ON, DROP, INSERT, UPDATE, and DELETE statements executed during the unit of recovery are backed out.

All locks implicitly acquired by the unit of recovery subsequent to its initiation are released.

ROLLBACK

This CA Datacom/DB extension has the same effect as ROLLBACK WORK.

A unit of work is made up of one or more units of recovery. In a batch environment, a unit of work corresponds to the execution of an application program. Within that program, there may be many units of recovery as COMMIT or ROLLBACK statements are executed.

A unit of recovery is a sequence of operations within a unit of work. A unit of recovery is initiated by:

  1. The initiation of a unit of work.
  2. The termination of a previous unit of recovery.

A unit of recovery is terminated by:

  1. A commit operation.
  2. A rollback operation.
  3. The termination of a unit of work.

A commit or rollback operation affects only the results of SQL statements executed within a single unit of recovery.

Uncommitted database changes made by a unit of recovery may or may not be perceived by other units of work depending on the isolation level that is selected.

Uncommitted database changes made by a unit of recovery can be backed out by CA Datacom/DB.

Committed database changes can be perceived by other units of recovery and cannot be backed out by CA Datacom/DB.

Database changes are backed out when a unit of recovery terminates abnormally.