문제

I am using Hibernate 3.6.10, MySQL database in my Play(Play 1.2.5) application. I am getting this error everyday

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.

After restarting the server, the application runs propertly. But after few hours I am getting the same error. Currently I am not using connection pool in my application.

도움이 되었습니까?

해결책

The above issue is solved when I add the following connection details to the hibernate-cfg.xml file

<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>

Add hibernate-c3p0.jar to the build path.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top