jFinal使用Druid连接Oracle,数据操作完之后报错?报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

jFinal使用Druid连接Oracle,数据操作完之后报错?报错

爱吃鱼的程序员 2020-06-14 21:58:06 291
close connection error
java.sql.SQLRecoverableException: IO 错误: Connection reset by peer: socket write error
	at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:556)
	at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:3984)
	at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:169)
	at com.alibaba.druid.filter.stat.StatFilter.connection_close(StatFilter.java:254)
	at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:165)
	at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.close(ConnectionProxyImpl.java:115)
	at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:82)
	at com.alibaba.druid.pool.DruidDataSource.discardConnection(DruidDataSource.java:967)
	at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:934)
	at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4544)
	at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:661)
	at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4540)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:880)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)
	at com.jfinal.plugin.activerecord.Config.getConnection(Config.java:185)
	at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:320)
	at com.jfinal.plugin.activerecord.DbPro.findFirst(DbPro.java:353)
	at pro.progress.ReadDatabaseFromOracle.process(ReadDatabaseFromOracle.java:48)
	at pro.progress.ReadDatabaseFromOracle.<init>(ReadDatabaseFromOracle.java:20)
	at pro.progress.ReadDatabase.execute(ReadDatabase.java:15)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.net.SocketException: Connection reset by peer: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
	at oracle.net.ns.DataPacket.send(DataPacket.java:210)
	at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:230)
	at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:312)
	at oracle.net.ns.NetInputStream.read(NetInputStream.java:260)
	at oracle.net.ns.NetInputStream.read(NetInputStream.java:185)
	at oracle.net.ns.NetInputStream.read(NetInputStream.java:102)
	at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124)
	at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80)
	at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137)
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:290)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
	at oracle.jdbc.driver.T4C7Ocommoncall.doOLOGOFF(T4C7Ocommoncall.java:61)
	at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:543)
	... 22 more
close connection error
java.sql.SQLRecoverableException: IO 错误: Connection reset by peer: socket write error
	at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:556)
	at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:3984)
	at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:169)
	at com.alibaba.druid.filter.stat.StatFilter.connection_close(StatFilter.java:254)
	at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:165)
	at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.close(ConnectionProxyImpl.java:115)
	at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:82)
	at com.alibaba.druid.pool.DruidDataSource.discardConnection(DruidDataSource.java:967)
	at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:934)
	at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4544)
	at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:661)
	at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4540)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:880)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)
	at com.jfinal.plugin.activerecord.Config.getConnection(Config.java:185)
	at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:320)
	at com.jfinal.plugin.activerecord.DbPro.findFirst(DbPro.java:353)
	at pro.progress.ReadDatabaseFromOracle.process(ReadDatabaseFromOracle.java:48)
	at pro.progress.ReadDatabaseFromOracle.<init>(ReadDatabaseFromOracle.java:20)
	at pro.progress.ReadDatabase.execute(ReadDatabase.java:15)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.net.SocketException: Connection reset by peer: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
	at oracle.net.ns.DataPacket.send(DataPacket.java:210)
	at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:230)
	at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:312)
	at oracle.net.ns.NetInputStream.read(NetInputStream.java:260)
	at oracle.net.ns.NetInputStream.read(NetInputStream.java:185)
	at oracle.net.ns.NetInputStream.read(NetInputStream.java:102)
	at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124)
	at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80)
	at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137)
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:290)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
	at oracle.jdbc.driver.T4C7Ocommoncall.doOLOGOFF(T4C7Ocommoncall.java:61)
	at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:543)
	... 22 more


当前的这段代码是quartz的定时任务里调取的一段读取oracle数据的一段,从oracle读出来写到mysql里,数据已经读过去了,只是tomcat报错了。



连接数操作 使用cli数据 oracle连接报错 oracle操作数据 acl操作
分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-14 21:58:22

    是不是超时?好像不是,时间间隔还没超过2分钟

    明显是连接重置,

    是不是请求处理时间过长,连接超时

    去过是请求时间过长连接重置,改怎么解决呢?   目测数据库服务器与应用服务器不在同一台机器上,两台机器间的socket连接不稳定,或者应用服务器与数据库服务器连接超时回复<aclass='referer'target='_blank'>@CodingKu:基本可以确定是访问超时了是的,确实不在一台上,是从另外一台的oracle读到本机的mysql。quartz里设置凌晨读一次,读完之后报的这个错。读的过程大约耗费2到5分钟,是不是时间太长了。druid什么版本?是不是没配置validationQuery?druid-1.0.5数据已经正确读取了,应该是读完后要关闭连接的时候报错的这个不影响使用,只是一个log.error。如果不喜欢这个logerror,使用最新版本吧:http://repo1.maven.org/maven2/com/alibaba/druid/1.0.9/是的,短时间内没影响。但是没次操作完数据库都报一个这个closeconnectionerror。总是怕长期运行不稳定啊。

    0 0
数据库
使用钉钉扫一扫加入圈子
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

相似问题
最新问题
推荐课程