[ERROR]2018-06-29 01:55:38,392 - com.alibaba.druid.util.JdbcUtils -close connection error
java.sql.SQLRecoverableException: IO Error: Connection reset
at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:770)
at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:4581)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:175)
at com.alibaba.druid.filter.stat.StatFilter.connection_close(StatFilter.java:261)
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:171)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.close(ConnectionProxyImpl.java:115)
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:73)
at com.alibaba.druid.pool.DruidDataSource.shrink(DruidDataSource.java:2662)
at com.alibaba.druid.pool.DruidDataSource$DestroyTask.run(DruidDataSource.java:2427)
at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2414)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at oracle.net.ns.Packet.receive(Packet.java:311)
at oracle.net.ns.DataPacket.receive(DataPacket.java:105)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:305)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:249)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:171)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:89)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:123)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:79)
at oracle.jdbc.driver.T4CMAREngineStream.unmarshalUB1(T4CMAREngineStream.java:426)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:390)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249)
at oracle.jdbc.driver.T4C7Ocommoncall.doOLOGOFF(T4C7Ocommoncall.java:59)
at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:757)
... 9 more
根据druid监控看出 打开连接池最大缓存为20个
可是真实打开和关闭的连接 远大于20个 则连接泄露
close connection error 关闭连接错误 也就是说在关闭连接的时候这个连接就已经失效啦
有可能还会有 close statement error 这个错误和上面同理
但是怎么解决还在摸索中 , 在网上的大浪中基本上都是说
打开removeAbandoned 之后还是没有解决这个问题
poolPreparedStatements 为false 时 PreparedStatement打开 和关闭数正常 但是问题还是没有得到解决
最终解决办法为 :
获取连接时验证该连接是否可用
jdbc.oracle.testOnBorrow=true
__只能暂时用这个方法解决当前问题
正常情况下他是不需要将testOnBorrow设置为true
邮箱地址 [email protected] 如果错误请联系我 或者私信我