commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject Re: DBCP connection pooling & close
Date Thu, 10 Mar 2005 23:11:52 GMT
On Thu, 2005-03-10 at 15:05 -0800, Mike Starbuck wrote:
> Does DBCP allow for a pool of open connections? 
> Running some test programs I noticed the the pool of
> active connections keeps growing unless I call
> conn.close() in which case it goes into the idle pool.
> What happens when conn.close() is called?  Is the
> physical connection closed or only a logical
> connection.  
> I am looking for a way to have a pool of open
> connections (sockets) that I can access for
> performance reasons.

The close call is overridden to just return the connection to the pool.
The physical connection is not closed. I presume it's done this way so
that existing code that is passed a connection and closes it when done
will work with pooling without needing to be modified.

If you don't call "close", then the pool thinks the connection is still
in active use, ie not yet available to be reused.



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

View raw message