Our software got tons of H2 exceptions. It all started with the following
### Error updating database. Cause: org.h2.jdbc.JdbcSQLException: IO Exception: "java.io.IOException: Stream Closed"; "/d1/data/fixflyerWeb/daytona.h2.db" [90031-166]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:158)
at org.h2.message.DbException.convertIOException(DbException.java:315)
at org.h2.store.FileStore.write(FileStore.java:330)
at org.h2.store.PageStore.writePage(PageStore.java:1323)
at org.h2.store.PageStreamData.write(PageStreamData.java:105)
at org.h2.store.PageOutputStream.storePage(PageOutputStream.java:146)
at org.h2.store.PageOutputStream.write(PageOutputStream.java:129)
at org.h2.store.PageLog.write(PageLog.java:533)
at org.h2.store.PageLog.commit(PageLog.java:553)
at org.h2.store.PageStore.commit(PageStore.java:1430)
at org.h2.engine.Database.commit(Database.java:1767)
at org.h2.engine.Session.commit(Session.java:450)
at org.h2.command.Command.stop(Command.java:144)
Then we get seemingly endless exceptions traces that start with the following:
org.springframework.dao.CannotAcquireLockException:
### Error updating database. Cause: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "ALERT"; SQL statement:
Things never seem to recover. We suspect that in the environment where this occurred that the H2 database file was located on a NAS and there may have been some network stability issues.
My question is if there was a network glitch during a database operation, can the code leave one or more tables locked such that subsequent accesses to those tables would lead to an endless series of CannotAcquireLockExceptions?
Would a newer version of H2 fix this?