MySQL used to require adding autoReconnect=true to the JDBC URL to prevent timeouts after you were idle for 8 hours or more. I believe this is the default now. Here's a (possible) related thread from the MySQL forums:
http://lists.mysql.com/java/9117 Matt On 9/6/07, Michael Horwitz <[EMAIL PROTECTED]> wrote: > Normally these are handled by configuring the connection pool to discard > connections after a period of inactivity, or, in extreme cases, by running a > test query before returning the connection from the pool. How is you > connection pool/datasource configured in your environment? > > Mike > > > On 9/5/07, romsrini <[EMAIL PROTECTED]> wrote: > > > > We are are getting the following error in the mornings after a night time > > full of no user activity. I strongly suspect it has to do with stale > > connections. Any best practices suggestions on how to handle or configure > > this ?: > > > > [lexy] WARN [2007-09-05 07:54:41,047] > > JDBCExceptionReporter.logExceptions(77) | > > SQL Error: 0, SQLState: 08S01 > > [lexy] ERROR [2007-09-05 07:54:41,048] > > JDBCExceptionReporter.logExceptions(78) > > | Communications link failure due to underlying exception: > > > > ** BEGIN NESTED EXCEPTION ** > > > > java.io.EOFException > > > > STACKTRACE: > > > > java.io.EOFException > > at > com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1963) > > at > com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2375) > > at > com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2874) > > at com.mysql.jdbc.MysqlIO.sendCommand > (MysqlIO.java:1623) > > at > com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1715) > > at > com.mysql.jdbc.Connection.execSQL(Connection.java:3249) > > at > > com.mysql.jdbc.PreparedStatement.executeInternal > (PreparedStatement.java:1268) > > at > > > com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1403) > > at > > > org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java > :93) > > at > > > org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) > > at > org.hibernate.loader.Loader.getResultSet(Loader.java:1778) > > at org.hibernate.loader.Loader.doQuery(Loader.java > :662) > > at > > > org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) > > at > org.hibernate.loader.Loader.doList(Loader.java:2211) > > at > > org.hibernate.loader.Loader.listIgnoreQueryCache > (Loader.java:2095) > > at > org.hibernate.loader.Loader.list(Loader.java:2090) > > at > org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388) > > at > > org.hibernate.hql.ast.QueryTranslatorImpl.list > (QueryTranslatorImpl.java:338) > > at > > > org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) > > at > org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) > > at org.hibernate.impl.QueryImpl.list > (QueryImpl.java:79) > > at > > > org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:849) > > at > > > org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java > :372) > > at > > > org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840) > > at > > > org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:836) > > at > > > com.lexy.dao.hibernate.CallerDaoHibernate.findByPhoneNumber(CallerDaoHibernate.java:29) > > -- > > View this message in context: > http://www.nabble.com/How-to-deal-with-potential-stale-connections-in-pool--tf4387600s2369.html#a12509187 > > Sent from the AppFuse - User mailing list archive at Nabble.com. > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
