Java 休眠连接错误

Java 休眠连接错误,java,hibernate,playframework,playframework-1.x,hibernate3,Java,Hibernate,Playframework,Playframework 1.x,Hibernate3,我在Play(Play 1.2.5)应用程序中使用Hibernate 3.6.10、MySQL数据库。我每天都会犯这样的错误 01:05:02,304 ERROR ~ The last packet successfully received from the server was 39,593,644 milliseconds ago. The last packet sent successfully to the server was 39,593,644 milliseconds a

我在Play(Play 1.2.5)应用程序中使用Hibernate 3.6.10、MySQL数据库。我每天都会犯这样的错误

01:05:02,304 ERROR ~ The last packet successfully received from the server was 39,593,644 milliseconds ago.  
The last packet sent successfully to the server was 39,593,644 milliseconds ago. is longer than the server configured value of 'wait_timeout'. 
You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

重新启动服务器后,应用程序将正常运行。但几个小时后,我得到了同样的错误。目前我没有在应用程序中使用连接池。

当我将以下连接详细信息添加到hibernate-cfg.xml文件时,上述问题已得到解决

<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
5
20
300
50
3000
将hibernate-c3p0.jar添加到构建路径