weblogic Connection has already been closed解决方法

   今天正式环境下的有一个功能报错,看了下weblogic日志,报连接已经关闭。

com.ibatis.common.jdbc.exception.NestedSQLException:   

--- The error occurred while applying a parameter map.  
--- Check the CheckErrorDetail.getDeviceErrorDetailCount-InlineParameterMap.  
--- Check the results (failed to retrieve results).  
--- Cause: java.sql.SQLException: Connection has already been closed.
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:568)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:543)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:83)

at com.comtop.product.component.simpleorm.dao.SimpleORMDAO.getObject(SimpleORMDAO.java:145)

     1. 了解了下功能,是一个定时器调用存储过程,伪代码:

        job { 

             创建一个数据库连接

             call   procedure1;

             call   procedure2;

             call   procedure3;

             call   procedure4;

             call   procedure5;

         }

      2. 分析错误,可以得出是执行第三个存储过程的时候报错,在pl/sql developer中分开执行5个存储过程没有问题。

      3. 代码已经运行二年,一直没有问题,只是最近有weblogic升级,检查weblogic配置, 非活动空闲连接超时时间是设置10s,以前设置的是-1(没有超时时间)。

      4. 把weblogic的非活动空闲连接超时时间是设置为-1,不用重启机器。调用定时器,功能执行成功了。

      总结:最终把非活动空闲连接超时时间是设置为180s,升级的时候,配置最好要参考以前的。

 

posted on 2013-09-30 22:22  you Richer  阅读(2580)  评论(0编辑  收藏  举报