Connection broken on localhost, why?

760 views
Skip to first unread message

abc6587

unread,
Sep 15, 2010, 10:17:35 PM9/15/10
to h2-da...@googlegroups.com
This was an intermittent error; all worked 10 sec before and 10 sec after. What could have caused it?

in thread AWT-EventQueue-0 on Wed Sep 15 16:09:56 PDT 2010
org.hibernate.exception.GenericJDBCException: Cannot open connection
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.custom.CustomLoader.list(CustomLoader.java:312)
       at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1723)
       at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
       at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
 ......................
Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "session closed" [90067-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.engine.SessionRemote.checkClosed(SessionRemote.java:447)
       at org.h2.engine.SessionRemote.removeServer(SessionRemote.java:394)
       at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:169)
       at org.h2.jdbc.JdbcConnection.getInternalAutoCommit(JdbcConnection.java:395)
       at org.h2.jdbc.JdbcConnection.getAutoCommit(JdbcConnection.java:387)
       at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:127)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
       ... 48 more

Thomas Mueller

unread,
Sep 20, 2010, 1:56:52 AM9/20/10
to h2-da...@googlegroups.com
Hi,

It sounds like the connection was already closed when Hibernate called
getAutoCommit(). If you are sure this isn't the problem, could you
somehow create a reproducible test case?

Regards,
Thomas

abc6587

unread,
Sep 22, 2010, 10:29:32 AM9/22/10
to h2-da...@googlegroups.com
Hi,

Maybe, but who and why would close a localhost connection? Do you feel it's a hibernate problem?

It happens almost daily, but I can't reproduce.




--
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:01:09 PM9/24/10
to h2-da...@googlegroups.com
Hi,

> Maybe, but who and why would close a localhost connection?

Maybe the server was stopped, or the connection was closed
(java.sql.Connection.close was called).

> Do you feel it's
> a hibernate problem?

No, I think your application closed the connection or stopped the server.

Regards,
Thomas

abc6587

unread,
Sep 27, 2010, 6:13:12 PM9/27/10
to h2-da...@googlegroups.com
Just for the reference - I found what it was. The database was on the same box, but it was routed via an external IP address, and when the router glitched, the connection went down with it. Solved by using
internal ip address (localhost would do, too, of course)


Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages