java.net.SocketTimeoutException: Read timed out问题排查

问题日志:
java.sql.SQLException: I/O Error: Read timed out
	at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1053) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:465) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1304) ~[jtds-1.2.5.jar:1.2.5]
	at net.sf.log4jdbc.sql.jdbcapi.StatementSpy.executeQuery(StatementSpy.java:731) ~[log4jdbc-log4j2-jdbc4-1.16.jar:na]
	at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:73) [c3p0-0.9.1.2.jar:0.9.1.2]
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:374) [c3p0-0.9.1.2.jar:0.9.1.2]
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishIdleResource(C3P0PooledConnectionPool.java:310) [c3p0-0.9.1.2.jar:0.9.1.2]
	at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTask.run(BasicResourcePool.java:1999) [c3p0-0.9.1.2.jar:0.9.1.2]
	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) [c3p0-0.9.1.2.jar:0.9.1.2]
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.6.0_43]
	at java.net.SocketInputStream.read(SocketInputStream.java:129) ~[na:1.6.0_43]
	at java.io.DataInputStream.readFully(DataInputStream.java:178) ~[na:1.6.0_43]
	at java.io.DataInputStream.readFully(DataInputStream.java:152) ~[na:1.6.0_43]
	at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:846) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:727) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:466) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:103) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.ResponseStream.peek(ResponseStream.java:88) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3932) ~[jtds-1.2.5.jar:1.2.5]
	at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1046) ~[jtds-1.2.5.jar:1.2.5]
	... 8 common frames omitted
2018-07-04 01:07:43 [ERROR] [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] jdbc.sqltiming - 221. Connection.getAutoCommit()

一般来说是数据库连接问题,没有连上或是网络问题(网络波动)。

查看服务器jdbc日志,发现报read timed out异常不是连续的,是间断的,查一段时间库断了,在查一段时间库又断了。。。。。

你可能感兴趣的:(数据库)