Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 36983 invoked from network); 6 Sep 2007 20:13:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Sep 2007 20:13:50 -0000 Received: (qmail 31300 invoked by uid 500); 6 Sep 2007 20:13:39 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 31239 invoked by uid 500); 6 Sep 2007 20:13:39 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 31230 invoked by uid 99); 6 Sep 2007 20:13:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2007 13:13:39 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of phil.steitz@gmail.com designates 64.233.182.187 as permitted sender) Received: from [64.233.182.187] (HELO nf-out-0910.google.com) (64.233.182.187) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2007 20:13:37 +0000 Received: by nf-out-0910.google.com with SMTP id c10so242368nfd for ; Thu, 06 Sep 2007 13:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=dq/HirTW8vDbAKnf3ZqyaqZ2Jdg8vT8qC/L3ZFGZGXc=; b=Q0GHYBTDBQDvs93Xazqxj8IMq7IN5EIi2B8MerJpAxYqnUQ5FA033a2CP35XLCFkSa3j1Yfae+KG8Xb/KT48fYRAGruc48TqBP4cjOGKHjeZLsgA66fdMukV4eWkGZJSTHb3jEeZBMaToYODte5Tn17CHxLM5Ss/QoAur9sN8QM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=OlKqPdpq+4lOJDqIAjtp6ZakA/tx5AwosYQGp5I4h9by7BRxZi+3Z6foo3oNYW2uBqPn6krA3Eqd67KIVWFDAeq8vCqH7BGB6bOBx59bWoKQWqvrW0gtYVwM8BPTphBV8RTaBeErusHOvoJN+Qzygr1Kw8nWhjSQZ3cN6VTPAR8= Received: by 10.78.146.11 with SMTP id t11mr478001hud.1189109595566; Thu, 06 Sep 2007 13:13:15 -0700 (PDT) Received: by 10.78.151.9 with HTTP; Thu, 6 Sep 2007 13:13:15 -0700 (PDT) Message-ID: <8a81b4af0709061313j21ccb12cg29d6117c1662ce41@mail.gmail.com> Date: Thu, 6 Sep 2007 13:13:15 -0700 From: "Phil Steitz" To: "Jakarta Commons Users List" , stafford@marine.rutgers.edu Subject: Re: DBCP - behavior of dbcp when db is restarted In-Reply-To: <46DF0DC2.2000602@marine.rutgers.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46DF0DC2.2000602@marine.rutgers.edu> X-Virus-Checked: Checked by ClamAV on apache.org On 9/5/07, Wm.A.Stafford wrote: > We are using DBCP in a refactored web application that, in the past, > used a locally written connection pool. This original pool always > checked a connection object to see if it was NULL before handing it > out. I was told that this was because the DB was unstable at one point > and the pool was handing out connections that were null after a db restart. > > I would like to know if this is an issue with DBCP. I can't image that > it would be, this seems like a common enough situation. However, the > higher ups are concerned that we have subtracted functionality by using > DBCP. DBCP can be configured to validate connections before lending them them to clients. Its method of doing so is to execute a "validation query" that must return at least one row to succeed. There is currently no built-in facility for testing for null or bad connections other than this. Assuming you are using BasicDataSource, the relevant configuration parameters to ensure connections are tested before being returned to clients are testOnBorrow and validationQuery (see http://commons.apache.org/dbcp/configuration.html). You can also force connections to be tested when they are returned to the pool by setting testOnReturn to true. DBCP's abilities to handle network and database failure / recovery scenarios are primitive - validation as above is pretty much all that exists and validation queries can hang in the event of a network failure (see http://issues.apache.org/jira/browse/DBCP-226). Patches, suggestions for improvement are welcome. Phil --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org