Closed GoogleCodeExporter closed 9 years ago
I don't know if this helps, but prior to the above exception, we got another
one. Using our own tool called "DBCreate" we tried to drop the database (which
has been created with 1.2.147) and tried to recreate the database from scratch,
using 1.3.158.
The very first statement "DROP ALL OBJECTS DELETE FILES" failed with the
following exception:
INFO 2011-08-02 11:32:00,638 DBCreate - #1: DROP ALL OBJECTS DELETE FILES
INFO 2011-08-02 11:32:00,638 DBCreate - Establishing new database connection...
INFO 2011-08-02 11:32:00,638 DBCreate - Connection parameters:
INFO 2011-08-02 11:32:00,638 DBCreate -
-Djdbc.url=jdbc:h2:file:C:/dev/temp/h2-matrix-db/matrix;MVCC=TRUE;LOCK_TIMEOUT=3
00000
INFO 2011-08-02 11:32:00,638 DBCreate - -Djdbc.driver=org.h2.Driver
INFO 2011-08-02 11:32:00,638 DBCreate - -Duser=sa
FATAL 2011-08-02 11:32:05,997 DBCreate - Error during DBCreate
org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "SYS"; SQL statement:
CREATE INDEX IF NOT EXISTS INFORMATION_SCHEMA.INDEX_LOB_TABLE ON
INFORMATION_SCHEMA.LOBS(TABLE) [50200-158]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:169)
at org.h2.message.DbException.get(DbException.java:146)
at org.h2.table.RegularTable.doLock(RegularTable.java:506)
at org.h2.table.RegularTable.lock(RegularTable.java:440)
at org.h2.engine.Database.addMeta(Database.java:713)
at org.h2.engine.Database.addSchemaObject(Database.java:802)
at org.h2.table.RegularTable.addIndex(RegularTable.java:290)
at org.h2.command.ddl.CreateIndex.update(CreateIndex.java:90)
at org.h2.command.CommandContainer.update(CommandContainer.java:71)
at org.h2.command.Command.executeUpdate(Command.java:212)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:177)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:152)
at org.h2.store.LobStorage.init(LobStorage.java:100)
at org.h2.store.LobStorage.removeAllForTable(LobStorage.java:147)
at org.h2.table.RegularTable.removeChildrenAndResources(RegularTable.java:675)
at org.h2.engine.Database.removeSchemaObject(Database.java:1563)
at org.h2.command.ddl.DropDatabase.dropAllObjects(DropDatabase.java:67)
at org.h2.command.ddl.DropDatabase.update(DropDatabase.java:36)
at org.h2.command.CommandContainer.update(CommandContainer.java:71)
at org.h2.command.Command.executeUpdate(Command.java:212)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:177)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:152)
at com.dorma.abraham.dbcmd.DBcmd.executeStatement(DBcmd.java:662)
at com.dorma.abraham.dbcmd.DBcmd.executeStreamInternal(DBcmd.java:441)
at com.dorma.abraham.dbcmd.DBcmd.executeStream(DBcmd.java:396)
at com.dorma.abraham.dbcmd.DBcmd.executeFile(DBcmd.java:373)
at com.dorma.abraham.dbcreate.DBCreate.executeScript(DBCreate.java:215)
at com.dorma.abraham.dbcreate.DBCreate.executeScripts(DBCreate.java:209)
at com.dorma.abraham.dbcreate.DBCreate.main(DBCreate.java:154)
Original comment by dmoeb...@gmx.net
on 2 Aug 2011 at 10:24
Hi Thomas,
I know have a _reproducible_ testcase!
The following attached file contains a database (created with 1.2.147) and a
tiny Java program that simply tries to execute the following statement: DROP
ALL OBJECTS DELETE FILES
If you try to execute the code using "java -cp .;<path-to>/h2.jar DropTest"
(with H2 1.3.158) you'll get the following exception:
Exception in thread "main" org.h2.jdbc.JdbcSQLException: Zeit³berschreitung
beim Versuch die Tabelle "SYS" zu sperren
Timeout trying to lock table "SYS"; SQL statement:
CREATE INDEX IF NOT EXISTS INFORMATION_SCHEMA.INDEX_LOB_TABLE ON
INFORMATION_SCHEMA.LOBS(TABLE) [50200-158]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:169)
at org.h2.message.DbException.get(DbException.java:146)
at org.h2.table.RegularTable.doLock(RegularTable.java:506)
at org.h2.table.RegularTable.lock(RegularTable.java:440)
at org.h2.engine.Database.addMeta(Database.java:713)
at org.h2.engine.Database.addSchemaObject(Database.java:802)
at org.h2.table.RegularTable.addIndex(RegularTable.java:290)
at org.h2.command.ddl.CreateIndex.update(CreateIndex.java:90)
at org.h2.command.CommandContainer.update(CommandContainer.java:71)
at org.h2.command.Command.executeUpdate(Command.java:212)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:177)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:152)
at org.h2.store.LobStorage.init(LobStorage.java:100)
at org.h2.store.LobStorage.removeAllForTable(LobStorage.java:147)
at org.h2.table.RegularTable.removeChildrenAndResources(RegularTable.java:675)
at org.h2.engine.Database.removeSchemaObject(Database.java:1563)
at org.h2.command.ddl.DropDatabase.dropAllObjects(DropDatabase.java:67)
at org.h2.command.ddl.DropDatabase.update(DropDatabase.java:36)
at org.h2.command.CommandContainer.update(CommandContainer.java:71)
at org.h2.command.Command.executeUpdate(Command.java:212)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:177)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:152)
at DropTest.main(DropTest.java:12)
OTOH if you open the database manually first using H2 1.3.158 and SQuirrelSQL
for example, then the database opens normally.
Original comment by dmoeb...@gmx.net
on 2 Aug 2011 at 1:22
Attachments:
Even more confusing: once you've opened and closed the database successfully
with 1.3.158, then the DropTest executes fine without errors. So the error
occurs only if the database is opened with 1.3.158 _for the first time_ and the
statement "DROP ALL OBJECTS DELETE FILES" is the first statement executed.
Strange.
Original comment by dmoeb...@gmx.net
on 2 Aug 2011 at 1:26
If the database is opened with 1.3.158 for the first time, H2 tries to create
the new system index "INDEX_LOB_TABLE", which is not existent in 1.2.147. This
interferes with the command "DROP ALL OBJECTS DELETE FILES" we are trying to
execute. After the exception occured, the database is corrupt. Any further
attempt to open the database leads to the exception above "File corrupted while
reading record: "not a btree index 4 QRTZ_JOB_DETAILS_DATA"".
Original comment by dmoeb...@gmx.net
on 2 Aug 2011 at 2:24
Hi,
Thanks for you test case! I am analyzing the problem now.
Original comment by thomas.t...@gmail.com
on 27 Aug 2011 at 8:29
Original issue reported on code.google.com by
dmoeb...@gmx.net
on 2 Aug 2011 at 9:50Attachments: