commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Nielsen <>
Subject Re: commons dbcp or pool problems
Date Fri, 22 Feb 2002 17:21:52 GMT
"Michael A. Smith" wrote:
> On Fri, 22 Feb 2002, Glenn Nielsen wrote:
> > I have been using Tomcat 4.1-dev and its new DBCP DataSource Factory
> > which uses commons-dbcp, which then uses other commons components
> > like commons-pool.
> >
> > Everything works fine, then all of a sudden GenericPool can no longer
> > get a db connection from the pool.  All attempts to get a connection
> > from the pool fail.  The only way to fix the problem is to stop and
> > restart Tomcat.  In case you ask, the db is running fine, and an
> > application which uses Torque to manage db connections continues
> > to work.  Only the commons-dbcp exhibits the failure.
> >
> > This has happen twice in the last 24 hours, both times were about 10 - 12
> > hours after Tomcat started up.  The first run was during the day with higher
> > traffic, the second was overnight with lower traffic.  During each run the
> > DBCP has handled many thousands of connection requests.
> >
> > Here is a snippet from the exception:
> >
> > 2002-02-22 08:47:53 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp
> > exception
> > java.util.NoSuchElementException: Timeout waiting for idle object
> >         at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source)
> >         at org.apache.commons.dbcp.PoolingDataSource.getConnection(Unknown Source)
> >         at
> > org.apache.taglibs.dbtags.connection.ConnectionTag.doEndTag(
> >         at org.apache.jsp.pastnumsearch$jsp._jspService(pastnumsearch$
> >
> Without knowing any details about the pool component (yet -- I plan on
> giving it a good look eventually), I suspect that you may have a pool
> leak.  Somewhere you're borrowing from the pool and not returning it to
> the pool.  Possibly the return of an object is not in a finally block and
> an rare exception causes it to lose one object.
> Then again, I haven't looked at the pool component, so I don't know
> whether this would be tye symptom for that problem or not.  Take what I
> say with a grain of salt.  Although it might be a good place to start
> looking.

Yes, that is something I looked at.  This dbcp is only used by dbtags
in JSP pages.  During these runs a JSP page failed only a couple of times
before the general dbcp connection pool failure started.  So this isn't
due to a JSP page failure causing a connection leak.

I am also looking into the JDBC driver and the DbTags JSP tag library.

The JSP Page Author is also going to be reviewing the code for his usage
of DbTags in his JSP pages.



Glenn Nielsen    | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message