Timeout trying to lock table "SYS" with runscript
Hi, In my application running h2 for years, i just updated : - h2 from 1.2.128 to 1.3.160 - hibernate from 3.3.2 to 3.6.5 I'm trying to restore a database from runscript command using query: RUNSCRIPT FROM 'xxx/data-backup.sql.gz' COMPRESSION GZIP Execution fails with error : Caused by: org.hibernate.exception.GenericJDBCException: could not execute native bulk manipulation query at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:219) at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1300) at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:365) at org.nuiton.topia.framework.TopiaContextImpl.restore(TopiaContextImpl.java:1338) ... 3 more Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "SYS"; SQL statement: SET CLUSTER '' [50200-160] 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:500) at org.h2.table.RegularTable.lock(RegularTable.java:434) at org.h2.engine.Database.lockMeta(Database.java:748) at org.h2.engine.Database.addDatabaseObject(Database.java:862) at org.h2.command.dml.Set.addOrUpdateSetting(Set.java:401) at org.h2.command.dml.Set.update(Set.java:101) at org.h2.command.dml.RunScriptCommand.execute(RunScriptCommand.java:66) at org.h2.command.dml.RunScriptCommand.update(RunScriptCommand.java:45) at org.h2.command.CommandContainer.update(CommandContainer.java:73) at org.h2.command.Command.executeUpdate(Command.java:219) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:143) at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129) at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:210) ... 6 more But, running the same query in h2 web server works well. Database is has beean tested with url : - jdbc:h2:file:/xxx/DemoRegion/data/data;FILE_LOCK=file;LOG=1;DEFAULT_LOCK_TIMEOUT=1000;DB_CLOSE_DELAY=0;LOCK_MODE=3;TRACE_LEVEL_FILE=0;TRACE_LEVEL_SYSTEM_OUT=0 - jdbc:h2:file:/xxx/DemoRegion/data/data;FILE_LOCK=no;LOG=1;DEFAULT_LOCK_TIMEOUT=1000;DB_CLOSE_DELAY=0;LOCK_MODE=3;TRACE_LEVEL_FILE=0;TRACE_LEVEL_SYSTEM_OUT=0 - jdbc:h2:file:/xxx/DemoRegion/data/data - jdbc:h2:file:/xxx/DemoRegion/data/data;MVCC=1 without success. I thinks the problem may be related to hibernate update, but i can't find any clue on this. Any idea ? Regards. -- Éric Chatellier
Le 07/10/2011 00:00, Eric Chatellier a écrit :
I'm trying to restore a database from runscript command using query: RUNSCRIPT FROM 'xxx/data-backup.sql.gz' COMPRESSION GZIP
Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "SYS"; SQL statement: This happen only with runscript, and set LOCK_MODE=0 just for runscript is a temporary workaround.
-- Éric Chatellier <chatellier@codelutin.com> Tel: 02.40.50.29.28 http://www.codelutin.com
Le 10/10/2011 10:52, Eric Chatellier a écrit :
Le 07/10/2011 00:00, Eric Chatellier a écrit :
I'm trying to restore a database from runscript command using query: RUNSCRIPT FROM 'xxx/data-backup.sql.gz' COMPRESSION GZIP Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "SYS"; SQL statement: This happen only with runscript, and set LOCK_MODE=0 just for runscript is a temporary workaround. I found the problem.
This only happen with the attached database : very very very old 'script to' backup, 5 years old ;) I will migrate it, so not really a problem. -- Éric Chatellier <chatellier@codelutin.com> Tel: 02.40.50.29.28 http://www.codelutin.com
participants (1)
-
Eric Chatellier