Java 错误日志中的通知

Java 错误日志中的通知,java,mysql,hibernate,jdbc,Java,Mysql,Hibernate,Jdbc,我们正在使用java+hibernate+c3p0。在某些情况下,会出现以下错误: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 70,401,557 milliseconds ago. The last packet sent successfully t

我们正在使用java+hibernate+c3p0。在某些情况下,会出现以下错误:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 70,401,557 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.
但在其他情况下:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 43,974,672 milliseconds ago.  The last packet sent successfully to the server was 43,974,674 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.
看来这些都是同样的错误。为什么在第二条日志消息中打印通知:

 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.
c3p0配置为

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> 
    <property name="driverClass" value="${database.driver_class}" /> 
    <property name="jdbcUrl" value="${database.url}" /> 
    <property name="user" value="${database.username}" /> 
    <property name="password" value="${database.password}" /> 
    <property name="maxPoolSize" value="600" /> 
    <property name="maxIdleTime" value="28790" /> 
</bean>

提前谢谢

你能发布你的c3p0配置吗?为什么在第二个日志消息中打印通知,因为在不同的点检测到故障,并且编码到这两个点的日志消息不同。请尝试将参数添加到池配置中。