H2 Corrupt database: Runtime Exception: rowCount expected 2593 got 2592, SQL Statement "INSERT [...]" [50000-172]

130 views
Skip to first unread message

Paul Erdos

unread,
Jun 9, 2016, 10:30:17 AM6/9/16
to H2 Database
Hello,
I get very often corrupted H2 databases, I'm able to recover them with the recovery tool but this is getting annoying because while the database is corrupt all insertions fail.

I'm using one of the latest H2 stable releases "h2-1.3.172.jar" yet the database gets corrupt, by analysing the database I realize somehow more than one row with the same unique id is inserted in a table with several thousands rows.
Hence further insertions in the table fail.

The database is shared between 2 windows machines running Java with the connection String "jdbc:h2:C:\HomeDir\db\mydb;create=true;AUTO_SERVER=TRUE;AUTO_RECONNECT=TRUE;TRACE_MAX_FILE_SIZE=3"

The database would work well if it weren't for these sporadic corruptions which happen regularly every month or so.

Thank you for your help.



Steve McLeod

unread,
Jun 10, 2016, 5:53:54 AM6/10/16
to H2 Database
You should at the very least be using H2 1.3.176, the most recent stable version. I suggest doing that and seeing if you get less corruption problems.

Paul Erdos

unread,
Jul 12, 2016, 6:11:16 AM7/12/16
to H2 Database
Ok I updated to h2-1.4.192 and switched to the MV database format.
Let's see if I'll get corruption again.
Reply all
Reply to author
Forward
0 new messages