1. 程式人生 > >mycat->oracle報java.sql.SQLException: 無法從套接字讀取更多的數據

mycat->oracle報java.sql.SQLException: 無法從套接字讀取更多的數據

奇葩 cal idl 圖片 tab most conn err www.

今天下午,測試環境清算的時候又出現了之前的一個異常,這次把錯誤信息全部打出來了,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之後,應用沒有重啟,再次運行,就沒有這個問題了。之前也是,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

mycat->oracle報java.sql.SQLException: 無法從套接字讀取更多的數據