HSQLDB Database Files and Recovery

The Standalone and Client/Server modes will in most cases use files to store all data to disk in a persistent and safe way. This document describes the meaning of the files, the states and the procedures followed by the engine to recover the data.

A database named 'test' is used in this description. The database files will be 'test.script', 'test.properties', 'test.data' and 'test.backup'.

Database Files

 

States

Database is closed correctly

This is the state after using the command, SHUTDOWN

Database is closed correctly with SHUTDOWN SCRIPT

This is the state after using the command, SHUTDOWN SCRIPT

Database is aborted

This may happen by sudden power off, Ctrl+C in Windows, but may be simulated using the command SHUTDOWN IMMEDIATELY.

Procedures

Database is closed correctly

Database is opened

Repair

The current test.data file is corrupt, but with the old test.data (from the test.backup file and test.script) and the current test.log, the database is made up-to-date. The database engine takes these steps:

This text is based on HypersonicSQL documentation, updated to reflect the latest version 1.7.2 of HSQLDB