Patch against version 2.2.9 (https://hsqldb.svn.sourceforge.net/svnroot/hsqldb/base/tags/2.2.9). Allows named snapshots of the database to be taken, and then dynamically restored at a later point. It extends the checkpoint command:
CHECKPOINT [ ‘name’ ] [ DEFRAG ]
and adds two more:
RESTORE [FROM] CHECKPOINT ‘name’;
DROP CHECKPOINT ‘name’;
Each named checkpoint exists as a saved copy of the database files stored in a <database>.checkpoints directory stored in the same directory as the main database. The restore command shuts down the database engine, restores the database files from the checkpoint backup and re-opens them all again, whilst keeping existing database sessions open.
Zipped patch file
The functionality for the proposed named checkpoint is provided in version 2.3.0 as a form of backup that stored all the database files (after an optional checkpoint).
The functionality for the proposed RESTORE .. will probably be added later this year or next year.
The functionality for DROP CHECKPOINT will not really be needed as you can just delete the backup files.