一段时间后JDBC通信链接失败 [英] JDBC communication link failure after some time

查看:111
本文介绍了一段时间后JDBC通信链接失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将JDBC与proxool连接池一起使用以连接到mysql DB. 我正在从多个线程中选择大量行,一段时间后出现错误,提示通信链接失败,发送到服务器的最后一个数据包是... ago. 我正在关闭每个线程中的connection,statement,resultSet. 提取时间逐渐增加,在5-10分钟后发生异常. 我怀疑这是内存泄漏,但找不到任何线索.

I am using JDBC with proxool connection pool to connect to mysql DB. I am selecting large number of rows from multiple threads and after some time i get an error saying communication link failure, Last packet sent to the server was ...ago. I am closing connection,statement,resultSet in every thread. The fetching time increases gradually and the exception occurs after 5-10 minutes. I doubt it is a memory leak, but cant find any clue.

请让我知道可能的原因.

Please let me know the possible reasons.

谢谢, 卡卡

推荐答案

它可能与您的连接超时有关,请尝试增加它.

it may related on your Connection Timeout, try to increase it.

con.setConnectionTimeout(X);

这篇关于一段时间后JDBC通信链接失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆