Contents IndexChoosing an isolation level Particular concurrency issues

User's Guide
   Part III. Using SQL Anywhere
     Chapter 19. Using Transactions and Locks
      Savepoints within transactions

Within a transaction, SQL Anywhere supports savepoints. Before Watcom SQL 4.0, a savepoint was referred to as a subtransaction.

A SAVEPOINT statement defines a point in a transaction where all changes after the point can be undone by a ROLLBACK TO SAVEPOINT statement. Once a RELEASE SAVEPOINT statement has been executed, the savepoint can no longer be used.

No locks are released by the RELEASE SAVEPOINT or ROLLBACK TO SAVEPOINT commands: locks are released only at the end of a transaction.

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 make use of the rollback log. They cannot be used in bulk operations mode. There is very little additional overhead in using savepoints.

Contents IndexChoosing an isolation level Particular concurrency issues