Unsupported database file version or invalid file header exception since 1.2.129

3,359 views
Skip to first unread message

Eric Chatellier

unread,
Feb 22, 2010, 5:09:50 AM2/22/10
to h2-da...@googlegroups.com
Hi,

Since update to 1.2.129, i got this error with some database (not all of
them)
org.h2.jdbc.JdbcSQLException: Unsupported database file version or
invalid file header in file "Old database:
/home/chatellier/isis-database-3/regions/DemoRegion/data/data.data.db -
please convert the database to a SQL script and re-create it." [90048-129]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:317)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.get(DbException.java:145)
at org.h2.engine.Database.open(Database.java:483)
at org.h2.engine.Database.openDatabase(Database.java:200)
at org.h2.engine.Database.<init>(Database.java:195)
at org.h2.engine.Engine.openSession(Engine.java:56)
at org.h2.engine.Engine.openSession(Engine.java:140)
at org.h2.engine.Engine.getSession(Engine.java:120)
at org.h2.engine.Session.createSession(Session.java:119)
at
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:236)
at org.h2.engine.SessionRemote.createSession(SessionRemote.java:214)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:111)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:95)
at org.h2.Driver.connect(Driver.java:58)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

All my database open fine with 1.2.128 version.

Here are some information :
* url :
jdbc:h2:file:/home/chatellier/isis-database-3/regions/DemoRegion/data/data;FILE_LOCK=file;LOG=1;MODE=hsqldb;DEFAULT_LOCK_TIMEOUT=1000;DB_CLOSE_DELAY=0;LOCK_MODE=3;TRACE_LEVEL_FILE=0;TRACE_LEVEL_SYSTEM_OUT=0
* I can't easily run sql script on broken databases

I attach a broken database sample.

Regards.

--
ᅵric <chate...@codelutin.com>
Tel: 02 40 50 29 28
http://www.codelutin.com

demoregion.zip

Thomas Mueller

unread,
Feb 22, 2010, 12:56:24 PM2/22/10
to h2-da...@googlegroups.com
Hi,

As described in the change log at
http://www.h2database.com/html/changelog.html version 1.2.129 does not
support databases created by earlier versions of H2 (the old database
file format).

See also the error message: "Old database: ... please convert the


database to a SQL script and re-create it".

I wrote a a tool to migrate an old database from the non-page store
format to the newest version:
http://h2database.googlecode.com/svn/trunk/h2/src/tools/org/h2/dev/util/Migrate.java

Regards,
Thomas

Eric Chatellier

unread,
Feb 24, 2010, 9:37:25 AM2/24/10
to h2-da...@googlegroups.com
Le 22/02/2010 18:56, Thomas Mueller a �crit :
Ok, thank you for your response.

I didn't noticed the change.

Last question. I need to do this migration automatically.
Is there a way to known if migration is needed before
opening database ?
Or catching this exception is the only way ?

Thanks
Regards.
> Regards,
> Thomas
>


--
�ric <chate...@codelutin.com>

Thomas Mueller

unread,
Feb 26, 2010, 10:08:25 AM2/26/10
to h2-da...@googlegroups.com
Hi,

> Is there a way to known if migration is needed before
> opening database ?
> Or catching this exception is the only way ?

Catching the exception is one way. Or you could check if a *.data.db
file exists.

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages