Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 74500 invoked from network); 16 Dec 2008 14:05:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Dec 2008 14:05:56 -0000 Received: (qmail 65485 invoked by uid 500); 16 Dec 2008 14:06:04 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 65430 invoked by uid 500); 16 Dec 2008 14:06:04 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 65419 invoked by uid 99); 16 Dec 2008 14:06:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Dec 2008 06:06:04 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [69.147.107.20] (HELO mrout1-b.corp.re1.yahoo.com) (69.147.107.20) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Dec 2008 14:05:43 +0000 Received: from reeva.grenoble.corp.yahoo.com (reeva.grenoble.corp.yahoo.com [10.76.44.188]) by mrout1-b.corp.re1.yahoo.com (8.13.8/8.13.8/y.out) with ESMTP id mBGE4mc9074935 for ; Tue, 16 Dec 2008 06:04:48 -0800 (PST) Message-ID: <4947B57F.109@free.fr> Date: Tue, 16 Dec 2008 15:04:47 +0100 From: Cyrille Roy User-Agent: Thunderbird 2.0.0.12 (X11/20080213) MIME-Version: 1.0 To: Commons Users List Subject: Re: Can someone tell me what maxIdle & maxActive do ? References: <21032459.post@talk.nabble.com> In-Reply-To: <21032459.post@talk.nabble.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, 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, Cyrille 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: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org