- 论坛徽章:
- 0
|
大家新年好:
新上的系统每天早上都发现如下的错误(mysql5.1.30+jdbc【使用的proxool连接池】+tomcat6.16):
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was49357 seconds ago.The last packet sent successfully to the server was 49357 seconds ago, which 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.
估计应该是mysql5到时间自己释放了所有的jdbc客户端程序连接,导致第二天第一个使用系统的人铁定碰到这个问题,不知道怎么配置mysql,有如下疑惑:
1、jdbc链接中已经添加了autoReconnect=true字样,字面上理解,应该是连接池到了一定时间,会自动去连接数据库。可是我在java程序中添加了貌似并没有生效。(貌似该问题更多的是 proxool这种java连接池的配置问题)
2、换一种解决思路:如何设置mysql,让mysql5永不自己杀客户端到数据库的连接(google到了wait_timeout interactive_timeout两个参数,可是不知道两个参数怎么设置让数据库永不自己杀链接)
---->让mysql永不杀掉客户端到自己的链接是不是一种合理的解决思路呢?是不是所有数据库都是这样做的呢?(比如oracle,难道oracle也超过了某个配置时间杀链接?)?
谢谢了,祝回帖的和看帖的牛年发大财。。。。霍霍 |
|