Exception: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL

6,114 views
Skip to first unread message

abc6587

unread,
Sep 16, 2010, 5:31:39 PM9/16/10
to h2-da...@googlegroups.com
I wonder what this exception is about? Sorry if the bug is on Hibernate side, I can't tell

org.hibernate.exception.GenericJDBCException: Cannot open connection
       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
       at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
       at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577)
       at org.hibernate.loader.Loader.doQuery(Loader.java:696)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
       at org.hibernate.loader.Loader.doList(Loader.java:2232)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
       at org.hibernate.loader.Loader.list(Loader.java:2124)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
       at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
       at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
       at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
       at ....EmployeeDAO.findAll(EmployeeDAO.java:234)
 
Caused by: org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-131]
       at org.h2.message.DbException.getJdbcSQLException(DbException.java:316)
       at org.h2.message.DbException.get(DbException.java:167)
       at org.h2.message.DbException.get(DbException.java:144)
       at org.h2.message.DbException.get(DbException.java:133)
       at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1347)
       at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1322)
       at org.h2.jdbc.JdbcConnection.getAutoCommit(JdbcConnection.java:385)
       at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:127)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
       ... 50 more

Thomas Mueller

unread,
Sep 24, 2010, 12:23:31 PM9/24/10
to h2-da...@googlegroups.com
Hi,

> I wonder what this exception is about? Sorry if the bug is on Hibernate
> side, I can't tell

Well, it looks like the database is already closed... I'm afraid I
can't explain why. To find out, you could append ;TRACE_LEVEL_FILE=3
to the database URL and check in the .trace.db file that the
connection was closed. Possibly you need to run it in debug mode and
set a breakpoint.

Regards,
Thomas

abc6587

unread,
Sep 24, 2010, 12:32:58 PM9/24/10
to h2-da...@googlegroups.com
Hi Thomas,

Thank you for your message. What do you mean when you say database is closed? Is it shut down? Not accepting connections? Or this particular connection is closed?


--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.


Thomas Mueller

unread,
Sep 24, 2010, 12:39:08 PM9/24/10
to h2-da...@googlegroups.com
Hi,

This particular connection is closed.

Regards,
Thomas

Thomas Mueller

unread,
Sep 24, 2010, 12:40:14 PM9/24/10
to h2-da...@googlegroups.com
Hi,

Sorry, actually: the database is closed.

It could have been closed by running SHUTDOWN, I forgot about that.
Did you execute SHUTDOWN?

Regards,
Thomas

abc6587

unread,
Sep 27, 2010, 6:03:37 PM9/27/10
to h2-da...@googlegroups.com
I never execute SHUTDOWN. What else could it be?


Regards,
Thomas

Thomas Mueller

unread,
Sep 29, 2010, 1:03:52 PM9/29/10
to h2-da...@googlegroups.com
Hi,

I don't really know, sorry. As I already wrote, to find out, you could

Reply all
Reply to author
Forward
0 new messages