commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Thomas (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (POOL-183) potential new method for interface ObjectPool<T>: returnAndValidateObject
Date Tue, 13 Dec 2011 16:07:30 GMT

     [ https://issues.apache.org/jira/browse/POOL-183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Thomas resolved POOL-183.
------------------------------

    Resolution: Fixed

factory getter added
                
> potential new method for interface ObjectPool<T>: 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
>             Fix For: 2.0
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message