jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18074] New: - closing tag
Date Mon, 17 Mar 2003 17:27:59 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18074>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18074

closing tag

           Summary: closing tag
           Product: Taglibs
           Version: 1.0
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DBTags Taglib
        AssignedTo: taglibs-dev@jakarta.apache.org
        ReportedBy: vanbochove@firstbase.nl


I think 1 line needs to be added to the doStartTag method of class
CloseConnectionTag. After closing the connection "conn" it needs to be set to
null, to assure a pooled connection will be put back to the connection pool:

  public int doStartTag() {

    try {
      Connection conn = (Connection)pageContext.getAttribute(_connId);
      conn.close();
      conn = null;
    } catch (SQLException e) {
      // failing to close a connection is not fatal
      e.printStackTrace();
    }
    
    return EVAL_BODY_INCLUDE;
  }

If the added we have to trust the garbage collector to return the connection. I
sometimes get this exception (stacktrace)

DBCP object created 2003-05-17 17:05:05 by the following code was never closed:
java.lang.Exception
        at org.apache.commons.dbcp.AbandonedTrace.init(AbandonedTrace.java)
        at org.apache.commons.dbcp.AbandonedTrace.<init>(AbandonedTrace.java)
        at
org.apache.commons.dbcp.DelegatingConnection.<init>(DelegatingConnection.java)
        at
org.apache.commons.dbcp.PoolableConnection.<init>(PoolableConnection.java)
        at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java)
        at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java)
        at
org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java)
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java)
        at
org.apache.taglibs.dbtags.connection.ConnectionTag.doEndTag(ConnectionTag.java:214)
        at org.apache.jsp.show_prod_jsp._jspService(show_prod_jsp.java:335)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.connector.warp.WarpRequestHandler.handle(Unknown
Source)
        at org.apache.catalina.connector.warp.WarpConnection.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Mime
View raw message