Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BE771FB5E for ; Tue, 30 Apr 2013 12:22:15 +0000 (UTC) Received: (qmail 93181 invoked by uid 500); 30 Apr 2013 12:22:12 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 92994 invoked by uid 500); 30 Apr 2013 12:22:12 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 92978 invoked by uid 99); 30 Apr 2013 12:22:11 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Apr 2013 12:22:11 +0000 Received: from localhost (HELO [192.168.23.9]) (127.0.0.1) (smtp-auth username markt, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Apr 2013 12:22:11 +0000 Message-ID: <517FB76D.7030701@apache.org> Date: Tue, 30 Apr 2013 13:22:05 +0100 From: Mark Thomas User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: maxWait References: In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit On 30/04/2013 12:59, Jose Mar�a Zaragoza wrote: > Hello: > > I'm using Tomcat 6.0.23 > I'm using DBCP library to pooling database connections. > > When I define a in context.xml > and set maxWait to 2000 ms , > sometimes datasource.getConnection() method lasts 15 seconds. > > I've to define loginTimeout parameter in JDBC driver to get the effect that > I want : a timeout retrieving a Connection > > What is the meaning of maxWait ? When is triggered this timeout (maxWait) ? maxWait is the maximum time DBCP will wait for a connection to become available if the pool is at full capacity (i.e. all permitted connections have been created and are currently allocated to other clients). In your case, no connection is available and there is still spare capacity in the pool so a new connection is created. That will take as long as it takes. Tomcat & DBCP have no control over it. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org