tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hume, John - NA US HQ Delray" <john.h...@cruisesonly.com>
Subject RE: Connection Pooling
Date Wed, 07 Jan 2004 18:19:29 GMT
Justin,
The DBCP that's bundled with Tomcat as well as most other pools (proxool for
one) return a java.sql.Connection implementation class that wraps the actual
DB driver java.sql.Connection implementation.  Calling close() on the
Connection that you got from the pool returns the underlying connection to
the pool for reuse.  

For DBCP, if you don't call close(), the connection is eventually considered
abandoned, and there are a few configuration parameters that affect what
happens at that point.  http://jakarta.apache.org/commons/dbcp/ for details.


-john.


-----Original Message-----
From: James Neville [mailto:james.neville@babcockbrown.com]
Sent: Wednesday, January 07, 2004 11:51 AM
To: Tomcat Users List
Subject: Re: Connection Pooling


Justin,

That would all depend on the pooling implementation you're using.
Commonly, its pool.free(conn) or pool.freeConnection(conn).
Remember *not* to close the connection if you're using connection 
pooling, as this should be handled by the pool itself.

That said.... one of my colleagues mentioned one pooling implementation 
he used that
returned a custom connection  object when obtained from the pool (ie not 
a java.sql Connection object).
The close() method on that connection returned it to the pool, but 
*didn't* actually close it.

If you let us know which pooling implementation you're using, it may 
make things clearer ;)

Cheers,

James

Hart, Justin wrote:

>Is there some manner in which a database connection should be returned
>to the connection pool, or is that automatic?
>
> 
>
>Justin
>
>
>  
>



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

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


Mime
View raw message