stale « Connection « JPA Q&A





1. How to handle stale connections?    stackoverflow.com

Ours is a J2EE app, using Struts-EJB-Hibernate on Websphere 6.1 over Mainframe/DB2 backend, that was recently moved to production. We are getting stale connection exception when the user login to ...

2. How to avoid stale MySQL/Hibernate connections (MySQLNonTransientConnectionException)    stackoverflow.com

I have a Java webapp using Hibernate and MySQL. If the site isn't used for a few days, the MySQL connection goes stale, and I am met with the following exception:

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: ...

3. Connection stale/obsolete problem when database reset    forum.hibernate.org

Hi All, I am facing following error whenever the database is restarted, and I need to restart application to make it work. I am using Hibernate 3.2 and c3p0-0.9.1.1.jar for connection pooling. Could not synchronize database state with session org.hibernate.exception.JDBCConnectionException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at ...

4. C3PO connection pool goes stale/ not getting called?    forum.hibernate.org

The FAQ for use with mySQL says to use C3P0 to avoid having Hibernate become unable to connect to the database after >hand waving< a while of inactivity. I do this. This does the job nicely on my Windows dev box. It however doesn't work so great when I deploy. The first query I try gives me an exception if nothing ...

5. Stale connection problem    forum.hibernate.org

Hi, Has anyone face the Stale connection problem?I am facing this problem when i run my application for the first time .But immediately after refresh it goes off.I am using WSAD provided JNDI name to connect to DB2 database.Sometimes this error comes in the middle and not at the start.Is there a way to specify to reconnect in the hibernate.properties file ...

6. Stale Connections with c3p0    forum.hibernate.org

Debug level Hibernate log excerpt: java.sql.SQLException: Io exception: Connection reset by peer: socket write error at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333) at oracle.jdbc.driver.OracleStatement.(OracleStatement.java:389) at oracle.jdbc.driver.OracleStatement.(OracleStatement.java:413) at oracle.jdbc.driver.OraclePreparedStatement.(OraclePreparedStatement.java:119) at oracle.jdbc.driver.OraclePreparedStatement.(OraclePreparedStatement.java:92) at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:950) at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:802) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:351) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:302) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:85) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1090) at org.hibernate.loader.Loader.doQuery(Loader.java:362) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:203) at org.hibernate.loader.Loader.doList(Loader.java:1499) at org.hibernate.loader.Loader.list(Loader.java:1482) at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1246) at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:299)