 |
» |
|
|
 |
 |
 |

5.10 Savepoints
Key points
- A SAVEPOINT is a transaction marker that allows you to roll back part of
a transaction.
ROLLBACK TO SAVEPOINT will not end the transaction or release
locks that were obtained prior to the setting of the SAVEPOINT, but it will
release locks that were obtained after the SAVEPOINT was issued.
- A SAVEPOINT can be placed anywhere between the
BEGIN WORK
and COMMIT WORK statements.
- Multiple
SAVEPOINT statements can be issued within a
transaction. ALLBASE/SQL
assigns a number to each one. The number is returned programmatically if a
host variable is provided when the SAVEPOINT statement is issued.
- The first SAVEPOINT number returned in a transaction is 1. The largest
possible SAVEPOINT number is (2**31)-1.
- In order to
ROLLBACK TO SAVEPOINT, the number of the appropriate SAVEPOINT
must be specified in the ROLLBACK WORK statement. Please refer to the example
for ROLLBACK WORK above.
- The slide shows that the SAVEPOINT is useful when the user decides not to
withdraw the $20.00, but still wishes the $100.00 transferred.

Page last updated on November 29, 1995
|
|
|