When ROLLBACK is used without the TO SAVEPOINT clause, the unit of work in which it is executed is ended. All changes made by SQL schema statements and SQL data change statements during the unit of work are backed out. For more information see Statements.
The generation of identity values is not under transaction control. Values generated and consumed by inserting rows into a table that has an identity column are independent of executing the ROLLBACK statement. Also, executing the ROLLBACK statement does not affect the IDENTITY_VAL_LOCAL function.
Special registers are not under transaction control. Executing a ROLLBACK statement does not affect special registers.
Sequences are not under transaction control. Executing a ROLLBACK statement does not affect the current value generated and consumed by executing a NEXT VALUE expression.
The impact of ROLLBACK or ROLLBACK TO SAVEPOINT on the contents of a declared global temporary table is determined by the setting of the ON ROLLBACK clause of the DECLARE GLOBAL TEMPORARY TABLE statement.
At the end of a ROLLBACK HOLD, the cursor position is the same as it was at the start of the unit of work, unless
After a successful ROLLBACK TO SAVEPOINT, the savepoint continues to exist.
All database changes (including changes made to declared temporary tables that were declared with the ON ROLLBACK PRESERVE ROWS clause) that were made after the savepoint was set are backed out. All locks and LOB locators are retained.
The impact on cursors resulting from a ROLLBACK TO SAVEPOINT depends on the statements within the savepoint:
Any savepoints that are set after the one to which rollback is performed are released. The savepoint to which rollback is performed is not released.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.