Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ROLLBACK WORK - Roll back transaction

You use ROLLBACK WORK to terminate an SQL transaction and undo all the updates performed since the end of the last SQL transaction. Some statements, such as SET SCHEMA for example, are also rolled back if they were executed before the start of the current transaction but after the end of the last transaction.

ROLLBACK WORK undoes the following updates:

  • updated data in SQL schemas

  • cursor positions saved with STORE

  • database and schema names set with SET CATALOG and SET SCHEMA

  • authorization identifiers defined with SET SESSION AUTHORIZATION

  • creation (ALLOCATE) and release (DEALLOCATE) of SQL descriptor areas

  • values set in SQL descriptor areas

All the cursors opened in the transaction or positioned with FETCH are closed. Dynamic statements and cursor descriptions prepared with PREPARE are lost.

The SET TRANSACTION statement and the utility statements cannot be rolled back.

The first error-free SQL statement that initiates a transaction executed after ROLLBACK WORK starts a new SQL transaction (see section "COMMIT WORK - Terminate transaction").



ROLLBACK [WORK]


Implicit execution of ROLLBACK WORK

SESAM/SQL rolls back an SQL transaction by implicitly executing a ROLLBACK WORK statement if one of the following situations occur:

    • An unrecoverable error occurs in the current transaction.

    • The specified isolation level cannot otherwise be ensured for two or more transactions that access certain SQL data concurrently (see also the “ Core manual”).

    • A transaction is interrupted for a long time and is using resources required by other transactions (see also the “ Core manual”).

The effect is the same as if ROLLBACK were called explicitly.

Transactions under openUTM

You cannot use the ROLLBACK WORK statement if you are working with openUTM. In this case, transaction management is performed using only UTM language resources. If a UTM transaction is rolled back, the SQL transaction is also rolled back.

CALL DML transactions

Within a CALL DML transaction, the SQL statement ROLLBACK WORK is not permitted (see section "SQL statements in CALL DML transactions").

See also

COMMIT