error thrown while trying to initialize database

18 views
Skip to first unread message

Rajesh

unread,
Dec 20, 2009, 11:02:24 PM12/20/09
to H2 Database
I am using h2 1.2.126 in server mode and I get this error sometimes
when I try to re-create my database using hibernate hbm2ddl utility.
Not sure what is causing this error to happen?

[WARNING] 1 errors occurred while performing <hbm2ddl>.
[ERROR] Error #1: org.h2.jdbc.JdbcSQLException: General error:
"java.lang.R
untimeException: page[27] data leaf table:0 entries:8 parent:5 keys:
[4798,
4800, 4802, 4804, 4806, 4808, 4810, 4812] offsets:[1460, 1390, 1277,
1195,
1072, 960, 593, 519] parent 5 expected 0" [50000-125]
at org.h2.message.Message.getSQLException(Message.java:111)
at org.h2.message.Message.convert(Message.java:288)
at org.h2.engine.Database.openDatabase(Database.java:262)
at org.h2.engine.Database.<init>(Database.java:222)
at org.h2.engine.Engine.openSession(Engine.java:58)
at org.h2.engine.Engine.openSession(Engine.java:142)
at org.h2.engine.Engine.getSession(Engine.java:122)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:121)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: page[27] data leaf table:0
entries:8
parent:5 keys:[4798, 4800, 4802, 4804, 4806, 4808, 4810, 4812]
offsets:[14
60, 1390, 1277, 1195, 1072, 960, 593, 519] parent 5 expected 0
at org.h2.message.Message.throwInternalError(Message.java:191)
at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:220)
at org.h2.index.PageDataIndex.<init>(PageDataIndex.java:74)
at org.h2.table.TableData.<init>(TableData.java:83)
at org.h2.store.PageStore.addMeta(PageStore.java:1298)
at org.h2.store.PageStore.redo(PageStore.java:1179)
at org.h2.store.PageLog.recover(PageLog.java:285)
at org.h2.store.PageStore.recover(PageStore.java:1045)
at org.h2.store.PageStore.openExisting(PageStore.java:304)
at org.h2.store.PageStore.open(PageStore.java:262)
at org.h2.engine.Database.getPageStore(Database.java:2313)
at org.h2.engine.Database.open(Database.java:626)
at org.h2.engine.Database.openDatabase(Database.java:228)
... 6 more

[INFO] General error: "java.lang.RuntimeException: page[27] data leaf
table
:0 entries:8 parent:5 keys:[4798, 4800, 4802, 4804, 4806, 4808, 4810,
4812]
offsets:[1460, 1390, 1277, 1195, 1072, 960, 593, 519] parent 5
expected 0"
[50000-126]

Thomas Mueller

unread,
Dec 21, 2009, 11:08:33 AM12/21/09
to h2-da...@googlegroups.com
Hi,

This looks like a serious problem. I have a few questions:

- Could you send the full stack trace of the exception including message text?
- What is your database URL?
- Did you use multiple connections?
- A workarounds is: use the tool org.h2.tools.Recover to create
the SQL script file, and then re-create the database using this script.
Does it work when you do this?
- With which version of H2 was this database created?
You can find it out using:
select * from information_schema.settings where name='CREATE_BUILD'
or have a look in the SQL script created by the recover tool.
- Did the application run out of memory (once, or multiple times)?
- Do you use any settings or special features (for example, the setting
LOG=0, or two phase commit, linked tables, cache settings)?
- Do you use any H2-specific system properties?
- Is the application multi-threaded?
- What operating system, file system, and virtual machine
(java -version) do you use?
- To you use temporary tables?
- Is it (or was it at some point) a networked file system?
- How big is the database (file sizes)?
- How much heap memory does the Java process have?
- Is the database usually closed normally, or is process terminated
forcefully or the computer switched off?
- Is it possible to reproduce this problem using a fresh database
(sometimes, or always)?
- Are there any other exceptions (maybe in the .trace.db file)?
Could you send them please?
- Do you still have any .trace.db files, and if yes could you send them?
- Could you send the .h2.db file where this exception occurs?

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages