views:

38

answers:

1

I am extensively using H2 database for my project (lots of inserts and selects) and I have noticed that in the database directory appear binary files which have the name: database.xx.log.db.corrupt, where xx - a number.

Does anybody know if there are possibility to understand what this file stands for and why it appears?

+2  A: 

At most one file with this name may be created when the database is started, after a crash (power failure or killed process), if the file header of the transaction log file (database.xx.log.db) is corrupt. Usually the file can be ignored, it's just not deleted to that the crash can be investigated if necessary. It doesn't mean you have lost data. By the way the relevant source code is here: http://code.google.com/p/h2database/source/browse/branches/version-1.1.x/h2/src/main/org/h2/log/LogSystem.java#300

This means you are using H2 version 1.1.x. In the meantime (since version 1.2.x) H2 doesn't use separate transaction log files. Instead, the transaction log is integrated into the main database file. I suggest to upgrade to a more recent version of H2.

Thomas Mueller
@Thomas Nice advice about the version!
Tim