ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <larry.mead...@gmail.com>
Subject Re: iBatis - Connections to PostgreSQL Not Closing
Date Mon, 19 Oct 2009 20:23:11 GMT
On Mon, Oct 19, 2009 at 1:17 PM, Jim Borland <jborland@calpoly.edu> wrote:
> pool.  I hadn't thought about that before.  I guess the bottom line is I
> don't really understand what is happening in a connection pool.  Still, my
> situation is so simple, yet the same bad outcome occurs no matter what I
> try.  Help!

A connection pool is simply a collection of connection objects that
are kept open as a performance optimization technique.

Creating network connection to a database server can be an expensive
operation (in terms of time), so often web servers will create a
"pool" of connections that are left open and then shared as needed.

When you ask for a "new" connection, you get an already opened
connection from the pool, instead of waiting for a new one to be
opened, and the pool marks it as in use so no one else gets it.

When you "close" that connection, the pool just marks it as available
so that it can be reused.

That may be why you are seeing idle connections when you aren't
expecting them. After you have closed the connection, it's still open
- that's how a pool works - but it may show up as idle.


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

View raw message