Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 33071 invoked from network); 25 Oct 2007 21:25:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Oct 2007 21:25:24 -0000 Received: (qmail 37276 invoked by uid 500); 25 Oct 2007 21:25:00 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 37245 invoked by uid 500); 25 Oct 2007 21:25:00 -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 37232 invoked by uid 99); 25 Oct 2007 21:25:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 14:25:00 -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 len.popp@gmail.com designates 209.85.146.178 as permitted sender) Received: from [209.85.146.178] (HELO wa-out-1112.google.com) (209.85.146.178) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 21:25:04 +0000 Received: by wa-out-1112.google.com with SMTP id m38so801930waf for ; Thu, 25 Oct 2007 14:24:39 -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=X8YbV2pFh5JgnyBIS+n1UhIUXbgI+Me34N89DijSkEg=; b=JEj0+9s71VNQu0hLz2uG6m3Z4EqXwqOiyD3NeVIqFPdjIgHgIrHoWsdbpTD7U1NL3MkurObdb2PjdsU6B0llWKNrbzscpSFSOFLgKBUrZ/YZQsdMRkn2dLYelByVXXU2nuUT58or30C1/+9bOb3CcXou3zbeAcKRHznb4/O3cII= 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=HE2ru98tQmS4aIQszcU2tf8RfzkVSfBIFYZS9Na2gbR12sI/GAw+WLblfIhB6ZgJGSI0AiNXZFaA9noTLpImLE12lDI5tRQwWy7plHc52Qp3syxbvRZjetGdKiHV7UjAR2scDj4O1Ivn9NLm942OAm3UxkYe94ba9PQk5g/4cNE= Received: by 10.114.130.1 with SMTP id c1mr2583566wad.1193347479155; Thu, 25 Oct 2007 14:24:39 -0700 (PDT) Received: by 10.114.39.20 with HTTP; Thu, 25 Oct 2007 14:24:34 -0700 (PDT) Message-ID: <497fac690710251424v160e90d9x1e1ac43dcc80f0de@mail.gmail.com> Date: Thu, 25 Oct 2007 17:24:34 -0400 From: "Len Popp" To: "Tomcat Users List" Subject: Re: Suggestions for connection pooling In-Reply-To: <40B0057E59252B40A70D1881216C4A0104348DCA@mail3.benefitconceptsinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <40B0057E59252B40A70D1881216C4A0104348D30@mail3.benefitconceptsinc.com> <40B0057E59252B40A70D1881216C4A0104348DCA@mail3.benefitconceptsinc.com> X-Virus-Checked: Checked by ClamAV on apache.org On 10/25/07, Tony Fountain wrote: > Now, my goal is to utilize connection pooling. Does (a) this > implementation achieve that and (b) the close statement suffice to > return the object to the pool and not actually close the connection? Or > do I also need to set "conn = null;"? You don't need to set conn = null, but you *do* need to make sure that the connection is closed in all cases, even when an exception is thrown. So: Connection conn = ds.getConnection(); try { ...do something... } finally { conn.close(); } -- Len --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org