Does Base/HSQLDB Embedded have a repair option?

I seem to remember that Access has a Repair option, also a Save and Repair option. Does such a thing exist for Base, or is it not necessary? Is there anything else needed to keep my little database ‘clean’? Thanks.

Don’t use embedded databases except for tutorials, demos or “less important” small databases.
Once you got all the tables, indices and relations right, you can easily extract an embedded HSQL and use it in stand-alone mode. In this mode, it is rather unlikely that you ever lose more than a few records when the office suite crashes.
Implement some reasonable backup strategy for all your data.

1 Like

Thank you. My database isn’t crucial but I’d hate for it to be corrupted somehow. I must look into extracting an embedded database.

[Python] Macro to extract and reconnect embedded HSQLDB

1 Like

In short, no, there isn’t. The default embedded hsqldb database is held at least partially in RAM, and can become irretrievably corrupted depending on what was going on in the system when LibreOffice crashed. The default crash recovery program of LibreOffice is supposed to help reduce the risk of loss, unfortunately this is not perfect, by any means.

1 Like

The constant zipping and unzipping of a whole database increases the risk of complete data loss as the database grows. Sooner or later, the Base document contains a damaged HSQLDB. if you are lucky, you find a working copy in a temporary folder.

1 Like

HSQL equivalent to Repair in Access is
CHECKPOINT DEFRAG

The HSQL command
SHUTDOWN COMPACT
is similar to Repair and Save
but you must close the Base database for it to take effect.

If you frequently delete records, even with a split database you should occasionally run one of those commands.

1 Like