Transaction Handling


This section describes the interface provided by CLSQL for handling database transactions. The interface allows for opening transaction blocks, committing or rolling back changes made and controlling autocommit behaviour.

Note

In contrast to CommonSQL, CLSQL, by default, starts in transaction AUTOCOMMIT mode (see set-autocommit). To begin a transaction in autocommit mode, start-transaction has to be called explicitly.

Table of Contents

START-TRANSACTION — Open a transaction block.
COMMIT — Commit modifications made in the current transaction.
ROLLBACK — Roll back modifications made in the current transaction.
IN-TRANSACTION-P — A predicate for testing whether a transaction is currently in progress.
ADD-TRANSACTION-COMMIT-HOOK — Specify hooks to be run when committing changes.
ADD-TRANSACTION-ROLLBACK-HOOK — Specify hooks to be run when rolling back changes.
SET-AUTOCOMMIT — Turn on or off autocommit for a database.
WITH-TRANSACTION — Execute a body of code within a transaction.