Checkpoints, savepoints, and transaction rollback
306
Rolling back to a savepoint
You can undo all changes after a savepoint by issuing a
ROLLBACK TO
SAVEPOINT
. This command rolls back to the savepoint you specify, or to the
most recent
SAVEPOINT
if you do not specify a named savepoint. Rolling back
to savepoint n undoes all actions for all savepoints greater than or equal to n.
Normally, locks are released only at the end of a transaction. However,
ROLLBACK TO SAVEPOINT
does release locks under certain conditions, as in
the following scenario.
Example
Assume that you have a series of savepoints in a transaction, and then perform
a write operation. You then roll back the transaction to an earlier savepoint. The
rollback undoes all actions after that savepoint, including the write operation
and any locks it acquires after the savepoint you are rolling back to.
Automatic and user-defined savepoints
IQ sets an implicit savepoint before and after every DML command. The data
page versions associated with these savepoints are released when the command
completes. If you want to retain data page versions beyond the end of a single
DML command, you need to set your own, named savepoints.
Naming and nesting savepoints
Savepoints can be named and they can be nested. By using named, nested
savepoints, you can have many active savepoints within a transaction. Changes
between a
SAVEPOINT
and a
RELEASE SAVEPOINT
can still be canceled by
rolling back to a previous savepoint or rolling back the transaction itself.
Changes within a transaction are not a permanent part of the database until the
transaction is committed. All savepoints are released when a transaction ends.
Savepoints cause Adaptive Server IQ to update information it maintains about
the location of available disk space. This information is used during transaction
rollback.
There is no additional overhead in using savepoints, although unreleased
savepoints may consume extra disk space by keeping older intermediate
versions active.
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...