当前位置:首页 > 开发 > 数据库 > 正文

java.sql.SQLException: Attempted to use Connection after closed() was called.

发表于: 2011-08-22   作者:beyondyl   来源:转载   浏览次数:
摘要: JDWP exit error JVMTI_ERROR_NONE(0): getting frame location [../../../src/share/back/stepControl.c:623]2011-07-30 12:12:01.906 WARN  [http-8088-Processor24] ConnectionManager.closeConnection (Con

JDWP exit error JVMTI_ERROR_NONE(0): getting frame location [../../../src/share/back/stepControl.c:623]
2011-07-30 12:12:01.906 WARN  [http-8088-Processor24] ConnectionManager.closeConnection (ConnectionManager.java:158) - Attempted to use Connection after closed() was called.
java.sql.SQLException: Attempted to use Connection after closed() was called.
 at org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.assertOpen(ConnectionImpl.java:140)
 at org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.setAutoCommit(ConnectionImpl.java:414)
 at com.young.uitl.database.ConnectionManager.closeConnection(ConnectionManager.java:153)
 at com.young.uitl.database.Database.executeUpdate(Database.java:41)
 at com.young.uitl.database.Database.update(Database.java:150)
 at com.young.struts.dao.GdzcDAO.tobeconfirmed(GdzcDAO.java:1320)
 at com.young.dwr.DWRService.tobeconfirmed(DWRService.java:1575)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
 at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)
 at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
 at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
 at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
 at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
 at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:619)
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d439053, pid=1784, tid=2404
#
# Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode windows-x86)
# Problematic frame:
# C

 

 

具体记不清楚了,就是在java代码里有一条update语句执行时报错 Attempted to use Connection after closed() was called.

1.发现数据库连接代码也没有错,而且update语句在数据库中执行正确。

2.设置断点调试,发现执行到运行sql语句时断点不执行,向控制台输出不了sql语句。

3.发现pl/sql里使用了select 表A for update,而且A表正是我java代码里更新的表;

所以只要断开与pl/sql连接即可。

 

java.sql.SQLException: Attempted to use Connection after closed() was called.

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
使用MVC4 EF Linq获取foreach列表循环的时候遇到了如下的问题:报错提示 There is already an open
错误信息: Caused by: java.sql.SQLException: Connection is read-only. Queries leading to data
1, 错误现象 2, Caused by: java.sql.SQLException: Connection has already been created in this
hive运行时Job initialization failed: java.io.IOException: Filesystem closed 分类: hive hadoo
今天从SVN更新代码时候报错,Attempted to lock an already-locked dir svn '.....' is already loc
先介绍下C中的modf函数 函数名:modf 头文件:<math.h> 函数原型:double modf(double x, dou
  git真是博大精深。   想通了这一点,再遇到什么奇怪的现象都不奇怪了,查文档就是了。   今
This is the first week for me to speak English formally. There’re two main problems: First,
而在一个文章的评论中,我看到这么一段话: 在f5的概念中,Connection就是指的一个TCP连接,在大多
类的关系为: is-a: has-a: use-a: is-a 为继承,或实现, has-a 为组合或聚集 use-a为使用。 类解
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号