Converting h2 database from h2.db to mv.db

2k views Asked by At

I am converting old h2 databases (with the h2.db extension) to the newer mv database engine. In some tables of the database I have a problem with the stricter engine.

just a SELECT * FROM does get an error, so with the latest h2-1.4.187.jar... i cannot even open the data anymore...

the error is in the TimeStampValue:

General error: "java.lang.IllegalArgumentException: timeNanos out of range 86400656000000"; SQL statement:
SELECT * FROM PURCHASES_DIVIDED [50000-187]

I am using the embedded way.

Now I try to find the rows using the old jar (h2-1.3.173.jar)

but cannot quite resolve the way how to find the troubled rows.. because all I query in the old database seem to work, and no errors to be catched...

anybody any clue how to solve this?

I thought of select the troubled rows with the old jar in db table, and fix the timestamp field there.... and than open with the new jar....

but than I need to find a way to select them...

1

There are 1 answers

0
michel.iamit On BEST ANSWER

I found a 'best of worse' solution:

When you use the recover function, you can create an sql dump file, and load in to a new database. (with the new version jar as well).

It will generate errors on the rows it cannot read, but the rest is done. So the corrupted rows just generate an error message. From the sql dump file I would even be able the fix it.... a lot of handwork, but is to be done.

Still hoping for a better solution given by somebody else.