commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cyrille Roy <>
Subject Re: Can someone tell me what maxIdle & maxActive do ?
Date Tue, 16 Dec 2008 14:04:47 GMT
for dbcp, an active connection is a connection where 
connectionPool.getConnection() has been called and 
connectionPool.getConnection().close() has not yet been called. In other 
words, a connection that is no more in the connection pool.

An idle connection is a connection where connectionPool.getConnection() 
and then connectionPool.getConnection().close() have been called.

Every time you get a connection from the pool, the number of active 
connection is increased, and the number of idle connection is decreased.
Internally, dbcp holds a list of connection ready to be served. This is 
the pool.

Basically, the number of connection opened to the db can be maxActive + 
minIdle, because the pool will make sure "minIdle" number of connections 
are created with the db .

Hope this helps,

munkee wrote:
> Hi,
> We've got a problem with tomcat and JDBC pooling, we set the maxActive to 6
> and maxIdle to 6, but this seems to then need 12 database connections to
> work with these settings. Can anyone explain this?
> We've 6 connections to the database to use, when we set maxActive to 6 and
> maxIdle to 0, this seems to be working as expected. Although if we leave it
> set to that then we're not using the pooling features as maxIdle isn't being
> used.
> Can anyone explain what maxIdle is, more than just : The maximum number of
> connections that can remain idle in the pool, without extra ones being
> released, or negative for no limit.
> Then what advantages we would have if we set maxActive to 3 and maxIdle to
> 3, thus enabling pooling.
> Many thanks,
> Ray. 

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

View raw message