Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 1263 invoked from network); 20 Jul 2007 06:23:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jul 2007 06:23:18 -0000 Received: (qmail 80676 invoked by uid 500); 20 Jul 2007 06:22:45 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 80601 invoked by uid 500); 20 Jul 2007 06:22:45 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 80590 invoked by uid 99); 20 Jul 2007 06:22:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jul 2007 23:22:45 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [208.97.132.81] (HELO spaceymail-a2.g.dreamhost.com) (208.97.132.81) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jul 2007 23:22:41 -0700 Received: from [192.168.15.106] (cpe-76-167-142-11.socal.res.rr.com [76.167.142.11]) by spaceymail-a2.g.dreamhost.com (Postfix) with ESMTP id B3172109FC4 for ; Thu, 19 Jul 2007 23:22:14 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <8a81b4af0707192233k655c7679gfeca1ec14cfc0e6b@mail.gmail.com> References: <20070718064621.9223A1A981A@eris.apache.org> <8a81b4af0707192233k655c7679gfeca1ec14cfc0e6b@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <8AF79E7E-751A-4206-9145-AC25E50D0179@iq80.com> Content-Transfer-Encoding: 7bit From: Dain Sundstrom Subject: Re: svn commit: r557176 - in /jakarta/commons/proper/dbcp/trunk: src/java/org/apache/commons/dbcp/ src/java/org/apache/commons/dbcp/cpdsadapter/ src/test/org/apache/commons/dbcp/ src/test/org/apache/commons/dbcp/managed/ xdocs/ Date: Thu, 19 Jul 2007 23:22:10 -0700 To: "Jakarta Commons Developers List" X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org I think passivate() is called automatically when the connection is put back in the pool (due to the _conn.close() call). I think there are tests that check that the statements were closed when the connection is closed. Anyway, I don't think it is a big deal to call passivate twice. It used to cause a SQLException because the delegating statements would throw an exception on the second close. -dain On Jul 19, 2007, at 10:33 PM, Phil Steitz wrote: > Sorry I missed this in initial review. I am not sure we want to > remove the passivate() below, since that closes statements traced by > this connection. Am I missing something here? > > Phil > > jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/ > DelegatingConnection.java > Tue Jul 17 23:46:16 2007 >> @@ -208,10 +208,17 @@ >> * Closes the underlying connection, and close >> * any Statements that were not explicitly closed. >> */ >> - public void close() throws SQLException >> - { >> - passivate(); >> - _conn.close(); >> + public void close() throws SQLException { >> + // close can be called multiple times, but >> PoolableConnection improperly >> + // throws an exception when a connection is closed twice, >> so before calling >> + // close we aren't alreayd closed >> + if (!isClosed()) { >> + try { >> + _conn.close(); >> + } finally { >> + _closed = true; >> + } >> + } >> } > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org