ROLLBACK


Executing a ROLLBACK causes the RDBMS to discard all changes made during the current transaction or, if the ROLLBACK statement includes a savepoint name, to discard only changes made since that savepoint. As with the COMMIT statement, all record locks are forfeited. However, APPX never automatically issues a ROLLBACK.

    ••••• ROLLBACK ••• •••••••••••••••••••••• •••
    (1)            (2) (3)                    (4)

(1) T/F execution conditions

(2) Application ID

(3) Field name or constant

(4) Occurrence (constant/index)

Using the Statement

The ROLLBACK statement can refer to a savepoint established by a previous SAVEPNT statement. If you include a savepoint name (either as a constant or as a field value) in a ROLLBACK statement, changes made since that savepoint are discarded but changes made prior to the savepoint are not. Without a savepoint, the entire transaction is discarded.

Note, however, that APPXIO files do not support transaction processing. If you ROLLBACK a change to an RDBMS-hosted file, any changes made to APPXIO will not be rolled back. Related to this is the issue of visibility. Changes made to an RDBMS-hosted file are invisible to other users until they are committed. Changes made to an APPXIO-hosted file are visible immediately.

Related PDFs

COMMIT MODE

Related Statements

COMMIT, SAVEPNT

Example

In the following example, if the flag indicates it is OK to commit, the COMMIT takes place and processing continues. Otherwise, changes made since the savepoint designated as TRX POINT 1 are discarded and the program branches to an applicable routine.

          SAVEPNT      TRX POINT 1
          *
          <perform RDBMS processing>
          *
          IF       TAR WORK OK TO COMMIT          NE     Y

    T     ROLLBACK     TRX POINT 1
    T     GOTO         :TRX POINT 1 STATUS
          COMMIT