hey all,
Given the following hibernate.cfg.xml:
Code:
<session-factory name="scape:/hibernate/SessionFactory">
<!-- <property name="connection.datasource">java:comp/env/jdbc/scapeDB</property>-->
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="connection.username">scape</property>
<property name="connection.password">scape</property>
<property name="connection.url">jdbc:mysql://localhost:3306/scape?autoReconnect=true</property>
<property name="connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<property name="dbcp.minIdle">1</property>
<property name="cache.use_query_cache">true</property>
<property name="use_outer_join">false</property>
<property name="hibernate.cglib.use_reflection_optimizer">false</property>
<!-- Mapping files -->
<mapping resource="object.hbm.xml"/>
</session-factory>
And the following hibernate.properties (yeah, that's all there is):
Code:
hibernate.cglib.use_reflection_optimizer=false
What additional configuration do I need to do to prevent the folowing error:
Code:
java.sql.SQLException: Communication link failure: java.net.SocketException, underlying cause: Connection reset
From what I understand, this is a JDBC error specifc to MySQL. Essentially after 8 hours, MySQL kills any idle connections. This is a default, however I had thought that setting the "autoReconnect" parameter to "true" in the JDBC url would solve this. It doesn't. Perhaps this is more of a JDBC question than a Hibernate question, but any infor would be great. Thanks!
--BW