Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 73821 invoked from network); 3 Feb 2011 20:31:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Feb 2011 20:31:53 -0000 Received: (qmail 53556 invoked by uid 500); 3 Feb 2011 20:31:52 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 53504 invoked by uid 500); 3 Feb 2011 20:31:52 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 53496 invoked by uid 99); 3 Feb 2011 20:31:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 20:31:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 20:31:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4DEE918CC9B for ; Thu, 3 Feb 2011 20:31:29 +0000 (UTC) Date: Thu, 3 Feb 2011 20:31:29 +0000 (UTC) From: "Gary Gregory (JIRA)" To: issues@commons.apache.org Message-ID: <205218344.8364.1296765089315.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1259848268.5823.1296677549181.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (POOL-183) potential new method for interface ObjectPool: returnAndValidateObject MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/POOL-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990290#comment-12990290 ] Gary Gregory commented on POOL-183: ----------------------------------- Also, the pool could track from which factory it was made. > potential new method for interface ObjectPool: returnAndValidateObject > ------------------------------------------------------------------------- > > Key: POOL-183 > URL: https://issues.apache.org/jira/browse/POOL-183 > Project: Commons Pool > Issue Type: New Feature > Affects Versions: 2.0 > Reporter: Zoltan Farkas > Priority: Minor > > Would it be possible to add a method: > void returnAndValidateObject(T obj) throws Exception > In general I was thinking of the following use case: > Object o = pool.borrowObject(); > try > { > ......... > o.doStuff(); > ......... > pool.returnObject(o); > } > catch(Exception e) > { > // not sure what the cause is, let's make sure o is valid. > pool.returnAndValidateObject(o); > } > the reason is that validation in general is an expensive operation, and enabling > it all the time is inpractical. > any thoughts ? -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira