Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 82072 invoked from network); 1 Nov 2004 20:34:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Nov 2004 20:34:54 -0000 Received: (qmail 61361 invoked by uid 500); 1 Nov 2004 20:34:47 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 61214 invoked by uid 500); 1 Nov 2004 20:34:46 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 61200 invoked by uid 99); 1 Nov 2004 20:34:46 -0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=DNS_FROM_RFC_ABUSE,FROM_ENDS_IN_NUMS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [206.190.38.71] (HELO web50406.mail.yahoo.com) (206.190.38.71) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 01 Nov 2004 12:34:45 -0800 Message-ID: <20041101203443.63887.qmail@web50406.mail.yahoo.com> Received: from [66.80.49.7] by web50406.mail.yahoo.com via HTTP; Mon, 01 Nov 2004 12:34:43 PST Date: Mon, 1 Nov 2004 12:34:43 -0800 (PST) From: David Graham Subject: Re: Statement closing in DbUtils To: Jakarta Commons Users List In-Reply-To: <41868EA8.2040609@eliashberg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N It's been nearly a year since 1.0 was released. I'll work on getting DbUtils 1.1 released relatively soon. David --- Alik Eliashberg wrote: > Ah, got it! Do you know when is the next release of DbUtils (that would > incorporate this fix)? > > Thank you, > > Alik > > David Graham wrote: > > >This was fixed some time ago as you can see in the latest source here: > >http://jakarta.apache.org/commons/dbutils/xref/org/apache/commons/dbutils/QueryRunner.html#235 > > > >The fix is in the nightly builds. > > > >Thanks, > >David > > > > > >--- Alik Eliashberg wrote: > > > > > > > >>Hello, > >> > >>I just started using the DbUtils package. I was reading the source > code > >>and I noticed the following potential problem: > >> > >>QueryRunner has a 'finally' clause in'query' method. This clause > closes > >>both ResultSet and the Statement. The problem is that it uses 'close' > >>not 'closeQuietly'. So it is possible that if the ResultSet close > fails, > >> > >>the Statement will remain open forever causing a driver/db resource > >>leak. Shouldn't the code be rewritten with another nested > 'try/finally': > >> try { > >> ... > >> } finally { > >> try { > >> DbUtils.close(rs); > >> } finally { > >> DbUtils.close(stmt); > >> } > >> } > >>[Alternatively, 'closeQuetly' can be used, but that would suppress the > > >>error...] > >> > >>TIA, > >> > >>Alik > >> > >> > >>--------------------------------------------------------------------- > >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > >>For additional commands, e-mail: commons-user-help@jakarta.apache.org > >> > >> > >> > >> > > > > > > > > > >__________________________________ > >Do you Yahoo!? > >Check out the new Yahoo! Front Page. > >www.yahoo.com > > > > > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > >For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org