Search code examples
javajpahsqldb

HsqlDb : how to make sure that data is really written to disk and crash resistant?


I have a java EE web application running under Tomee.

HsqlServer as well as the clint code is running within the same Java EE web application. Everything is running fine.

But when the server crashes, I regularly lose weeks of the latest hsql database changes.

The sql changes are visible through hsqldb, because if I connect to the hsqldb server with an external sql tool, I can see my new data.

But as soon as the server is terminated abnormally, hsqldb does lose data.

I already issue regularly "checkpoint" commands. But that doesn't fix the problem.

Is there any other command that will really write all changes to disk in a crash resistant way ?

thank you!


Solution

  • I found out that I had

    SET FILES LOG FALSE
    

    I guess that this is the reason for the data losses that I had.

    I now use

      SET FILES LOG TRUE
    

    (What I do not understand: According to the docs, a "checkpoint" operation should write all changes to disk even with logs disabled. And this does not work...)

    Thank you !