用java写了一个桌面程序,每隔20分钟往指定oracle数据库上传数据。查看错误日志的时候,发现经常上传失败,java.sql.SQLException: Io 异常: Connection reset ,但是20分钟程序自动上传又没问题。一句话 不定时会连接失败,oracle数据库 是公司服务器 。。下面我贴一部分错误日志

解决方案 »

  1.   

    2011-09-07 07:36:37 [ERROR] - [AWT-EventQueue-0] 上传到分公司数据失败:050120110907073229000时间:2011-09-07 07:36
    2011-09-07 08:56:36 [ERROR] - [AWT-EventQueue-0] Failed to insert - id [saveFgsjlQyd], parameterObject [com.wateray.ipassbook.domain.F_Jl@6d0085]. Cause: com.ibatis.common.jdbc.exception.NestedSQLException:   
    --- The error occurred in com/wateray/ipassbook/persistence/sqlmapdao/sql/F_Jl.xml.  
    --- The error occurred while executing mapped statement.  
    --- Check the saveFgsjlQyd.  
    --- Check the statement or the result map.  
    --- Cause: java.sql.SQLException: Io 异常: Connection reset上传到分公司数据失败:050120110907084032000时间:2011-09-07 08:56
    com.ibatis.dao.client.DaoException: Failed to insert - id [saveFgsjlQyd], parameterObject [com.wateray.ipassbook.domain.F_Jl@6d0085]. Cause: com.ibatis.common.jdbc.exception.NestedSQLException:   
    --- The error occurred in com/wateray/ipassbook/persistence/sqlmapdao/sql/F_Jl.xml.  
    --- The error occurred while executing mapped statement.  
    --- Check the saveFgsjlQyd.  
    --- Check the statement or the result map.  
    --- Cause: java.sql.SQLException: Io 异常: Connection reset
    at com.ibatis.dao.client.template.SqlMapDaoTemplate.insert(SqlMapDaoTemplate.java:103)
    at com.wateray.ipassbook.persistence.sqlmapdao.F_JlDaoImpl.saveFgsjlQyd(F_JlDaoImpl.java:88)
    at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
    at $Proxy21.saveFgsjlQyd(Unknown Source)
    at com.wateray.ipassbook.kernel.service.F_JlService.getJlQByCondition(F_JlService.java:194)
    at com.wateray.ipassbook.ui.view.contentPanel.DataManagerPage$1.actionPerformed(DataManagerPage.java:103)
    at javax.swing.Timer.fireActionPerformed(Unknown Source)
    at javax.swing.Timer$DoPostEvent.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
    --- The error occurred in com/wateray/ipassbook/persistence/sqlmapdao/sql/F_Jl.xml.  
    --- The error occurred while executing mapped statement.  
    --- Check the saveFgsjlQyd.  
    --- Check the statement or the result map.  
    --- Cause: java.sql.SQLException: Io 异常: Connection reset
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
    at com.ibatis.dao.client.template.SqlMapDaoTemplate.insert(SqlMapDaoTemplate.java:101)
    ... 18 more
    Caused by: java.sql.SQLException: Io 异常: Connection reset
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
    at oracle.jdbc.driver.T4CConnection.doRollback(T4CConnection.java:578)
    at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:1164)
    at com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.java:629)
    at com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.java:222)
    at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48)
    at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
    ... 22 more
    2011-09-07 08:56:36 [ERROR] - [AWT-EventQueue-0] 上传到分公司数据失败:050120110907084032000时间:2011-09-07 08:56
      

  2.   

    Cause: java.sql.SQLException: Io 异常: Connection reset'根据这个提示,有以下几种可能:
    1、profile的问题
    你们公司的ORACLE数据库是否为了优化数据库连接,对profile进行了相关的优化,在空闲一定时间后自动断开连接..
    用这个语句查看下:select * from dba_profiles where resource_name = 'IDLE_TIME'
    看看LIMIT(允许空闲时间)是多少的..2、你们公司防火墙的问题
    以前也遇到过,在一定时间之后,应用就无法连接了,后来检查一下,发现是客户的防火墙有上述相关的设置导致.LZ也可以检查以下。我遇到的基本就这两种,希望能有帮助.
      

  3.   

    select * from dba_profiles where resource_name = 'IDLE_TIME'查询无此表 ,,前几天忙,一直没过来看。。在说一下  不止做了一个这样的程序 在其他地方运行都还可以,怀疑可能是因为部署程序的那个电脑网络问题,有什么方法 能查 或者检测下嘛???
      

  4.   


    问题2, 有些防火墙对idel连接有一定的时效。