Search code examples
javadatabasehsqldb

HSQLDB: Memory table and data loss


Situation: memory table is created and database is used as file:. As I understand this case all data must be contained in .script file. My question is what happens if hsqldb after some inserts is closed not in a proper way? For example someone pushes power button on server box.

The core of this question is when does hsqldb save data to file when memory tables are used.


Solution

  • There is also a .log file that records all the INSERT, UPDATE and DELETE statements. When the database is restarted, the .log file is read and the data is restored to the point of power loss.