转载:http://binma85.iteye.com/blog/1318477
今天在使用JDBC操作mysql时遇到下面的异常信息:
binma85 写道
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at com.tomymap.galaxy.virgo.util.DbService.getConnection(DbService.java:66)
at com.tomymap.galaxy.virgo.util.DbService.getConnection(DbService.java:46)
at com.tomymap.galaxy.virgo.dao.PNNDao.getConnection(PNNDao.java:51)
at com.tomymap.galaxy.virgo.dao.DaoBase.executeUpdate(DaoBase.java:69)
at com.tomymap.galaxy.virgo.dao.PNNDao.updatePNNRelation(PNNDao.java:161)
at com.tomymap.galaxy.virgo.pnn.PyramidNeuralNetwork.buildPNNRelations(PyramidNeuralNetwork.java:400)
at com.tomymap.galaxy.virgo.pnn.PyramidNeuralNetwork.incrementalGenPNN(PyramidNeuralNetwork.java:144)
at com.tomymap.galaxy.virgo.pnn.PyramidNeuralNetwork.main(PyramidNeuralNetwork.java:410)
着实让人崩溃的信息,花费了一天的时间来解决。
不罗嗦,直接描述解决办法。
配置:
ubuntu10.10
5.1.49-1ubuntu8.1
mysql-connector-java-5.1.18.jar
交互:
300k records
300k * 10 = 3M次访问mysql
处理时间0.5h以内
解决方法:
(1)使用JDBC URL中使用autoReconnect属性,url添加
&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
(2) 修改MySQL的参数. /etc/my.cnf 添加
[mysqld]
wait_timeout=31536000
interactive_timeout=31536000
(3)重启mysql
分享到:
相关推荐
@[Android studio通过jdbc连接mysql基本步骤 以及 遇到的坑“The last packet sent successfully to the server was 0 milliseconds ago”哈哈] 小白第一次发博客哈哈,记录一下这三个晚上来我的悲惨经历以及我成功...
Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException The last packet successfully received from the server was 47,795,922 ... The last packet sent successfully to the server was 47,795,922
compose up 请注意,第一次运行时,您可能会看到: mvw_flyway | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. (Caused by...
2.查看数据库表创建完成后,我们可以查看数据库表show tables 2.修改表记录2.1 不带条件的update 表名 set 字段名=值, 字段名=值,
The last packet successfully received from the server ... The last packet sent successfully to the server was 56,201,339 milliseconds ago. is longer than the server configured value of ‘wait_timeout’
Wiley.Evolved.Packet.System.The.LTE.and.SAE.Evolution.of.3G.UMTS.Mar.2008.pdf Wiley.Evolved.Packet.System.The.LTE.and.SAE.Evolution.of.3G.UMTS.Mar.2008.pdf Wiley.Evolved.Packet.System.The.LTE.and.SAE....
Evolved.Packet.System.The.LTE.and.SAE.Evolution.of.3G.UMTS.2008
思科路由器交换机模拟软件].Packet.Tracer5.3.0.0088.part1,还有part2
An ISP earns its money by charging each of the the ISPs that connect to the IXP a relatively small fee, which may depend on the amount of traffic sent to or received from the IXP. 15. Google's ...
Updated to cover Wireshark 2.x, the third edition of Practical Packet Analysis will teach you to make sense of your packet captures so that you can better troubleshoot network problems. You’ll find ...
[网络核心协议袖珍手册].(Packet.Guide.to.Core.Network.Protocols).Bruce.Hartpence.文字版
eNSP.exe 打开需要使用的动态...由于找不到packet.dll,无法继续执行代码,重新安装程序可能会解决此问题 解决办法: 复制Packet.dll 到 C:\Windows\SysWOW64 和 C:\Windows\System32 目录下,再次启动软件即可正常。
Packet.Tracer5.3.0.0088-汉化包
Packet.Tracer5.2.0.0068.part1内含汉化包
There are different queuing strategies, and these determine not only the performance of the interconnection network, but also the set of requirements to make them work effectively and their cost....
思科路由器交换机模拟软件].Packet.Tracer5.3.0.0088.part4还有part 5
思科路由器交换机模拟软件].Packet.Tracer5.3.0.0088.part3,,还有part4
思科路由器交换机模拟软件].Packet.Tracer5.3.0.0088.part2,还有part3
融合多个面上光强信息的混合迭代相位恢复算法