tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <>
Date Fri, 23 Sep 2005 11:37:17 GMT
1. Does tomcat really look into the pool?

Yes.  The pool code is really the commons DBCP project code refactored
slightly to avoid collisions with the real DBCP project code.

2. on conn.close(), are we really pushing the connection back into the pool?


Sorry I can't help you on the Eclipse debugger question since I don't
use it.  It may be an artifact of the debugger or maybe DBCP's code. 
You might find the DBCP project documentation helpful in answering these
questions though.


rahul wrote:

>Hi all,
>My questing is derived from the sample code given
>at :
>If you can see the subsection 4(i.e. testcode) of section "MySQL DBCP
>to get a connection following code is used:
>Context ctx = new InitialContext();
>if(ctx == null )
>throw new Exception("Boom - No Context");
>DataSource ds =
>if (ds != null) {
>Connection conn = ds.getConnection();
>I guess by doing this a connection is obtained FROM THE POOL providing that
>a connection is free in the pool.
>I have got two questions regarding this-
>Q 1. Does tomcat really looks into the pool to get me a connection? or it
>just creates
>a newone? I am asking this question because I am seeing(using eclipse
>two connection opened at the same time even after defining
>maxActive="1" maxIdle="1" in my application'c context
>Q 2. once your database operation is done you free the connection using
>by doing this are we pushing the connection back into pool? if not then how
>pool maintained?
>Any help is appreciated
>To unsubscribe, e-mail:
>For additional commands, e-mail:

David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture & Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939

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

View raw message