Cannot open a database created with 1.3.55 (and earlier) with 1.3.57 if the database has CLOBs or BLOBs

35 views
Skip to first unread message

Jeffrey Krzysztow

unread,
Jul 8, 2011, 9:50:28 AM7/8/11
to h2-da...@googlegroups.com
When I try to upgrade to the currently released 1.3.57, I get this error trying to open existing databases:

org.h2.jdbc.JdbcSQLException: File corrupted while reading record: "-1 of 582". Possible solution: use the recovery tool; SQL statement:
CREATE CACHED TABLE IF NOT EXISTS INFORMATION_SCHEMA.LOB_MAP(
    LOB BIGINT NOT NULL,
    SEQ INT NOT NULL,
    HASH INT,
    BLOCK BIGINT
)
HIDDEN [90030-157]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
        at org.h2.message.DbException.get(DbException.java:167)
        at org.h2.message.DbException.get(DbException.java:144)
        at org.h2.store.PageStore.readPage(PageStore.java:1244)
        at org.h2.store.PageStore.getPage(PageStore.java:701)
        at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:223)
        at org.h2.index.PageDataIndex.<init>(PageDataIndex.java:81)
        at org.h2.table.RegularTable.<init>(RegularTable.java:92)
        at org.h2.schema.Schema.createTable(Schema.java:542)
        at org.h2.command.ddl.CreateTable.update(CreateTable.java:130)
        at org.h2.engine.MetaRecord.execute(MetaRecord.java:58)
        at org.h2.engine.Database.open(Database.java:607)
        at org.h2.engine.Database.openDatabase(Database.java:220)
        at org.h2.engine.Database.<init>(Database.java:215)
        at org.h2.engine.Engine.openSession(Engine.java:56)
        at org.h2.engine.Engine.openSession(Engine.java:159)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:138)
        at org.h2.engine.Engine.createSession(Engine.java:121)
        at org.h2.server.TcpServerThread.run(TcpServerThread.java:124)
        at java.lang.Thread.run(Thread.java:662)

        at org.h2.engine.SessionRemote.done(SessionRemote.java:538)
        at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:109)
        at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:373)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:267)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:110)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:94)
        at org.h2.Driver.connect(Driver.java:72)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)

database2 - 1.3.155.zip
database2 - 1.3.157.zip

jeffrey....@gmail.com

unread,
Jul 12, 2011, 11:41:48 AM7/12/11
to H2 Database
Anyone able to duplicate this or is it just my application?

Thomas Mueller

unread,
Jul 12, 2011, 12:59:01 PM7/12/11
to h2-database

Hi,

Yes, this is a serious problem. It is again related to the BLOB / CLOB optimization in version 1.3.156. But the bug actually existed before that, and just didn't show up so far. I found and fixed the problem now (in the trunk). Unfortunately, you will need to use the Recover tool to restore the data. I'm sorry about that.

Thanks a lot for your help!

Regards,
Thomas

Jeffrey Krzysztow

unread,
Jul 12, 2011, 5:02:39 PM7/12/11
to h2-da...@googlegroups.com
You are welcome!

This is not good news.

Jeffrey
Reply all
Reply to author
Forward
0 new messages