mycat->oracle报java.sql.SQLException: 无法从套接字读取更多的数据

今天下午,测试环境运行的时候又出现了之前的一个异常,这次把错误信息全部打出来了,java.sql.SQLException: 无法从套接字读取更多的数据,是使用mycat连接oracle的,如下所示:

ORA-17410: No more data to read from socket 

Your database connection has timed out, either due to network problems or due to Oracle reaching the IDLE_TIME profile limit. 

Your application however tried to use the connection, but as the connection has closed, failed to do so. 
This error mostly happens when using connection pools. Normally, when a connection is timed out or gone, the application should automatically reconnect. 
Failure to do so results in this error.

经查,oracle后台以及alert.log没有任何异常,也不应该是oracle jdbc驱动的问题,trace文件也没有异常。

看了下mycat.log,13:00之后,心跳就没发了,如下:

重启mycat之后,应用没有重启,再次运行,就没有这个问题了(所以原因无非是:1、网络负载太高、超时;2、oracle服务器刚好重启、但是未超过jdbc连接池的空闲重试,于是第一次执行的时候出现该异常;3、驱动层使用有问题。屡试不爽)。之前也是,mycat经常遇到各种奇葩问题,因为我们是两台虚拟机,不排除网络不稳定,但是都没有解决方案。看下用的是dataHost的连接数都很大,应该不是这个问题,只有三个心跳日志是因为配置了三个dataHost。

不过我们已经打算切换sharding-jdbc了。

参考:

https://blog.csdn.net/liduote/article/details/70227040

https://blog.csdn.net/sinat_33517300/article/details/78968181

http://www.iteye.com/problems/38600

https://blog.csdn.net/xiaopeng187/article/details/25797885

posted @   zhjh256  阅读(19224)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
点击右上角即可分享
微信分享提示