[ 
https://issues.apache.org/jira/browse/POOL-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855639#action_12855639
 ] 

Phil Steitz commented on POOL-155:
----------------------------------

I didn't say it was legitimate, just that there is nothing in the contract or 
GOP implementation that prevents it ;)

There are lots of ways for clients to prevent nulls in the factory methods, so 
I don't think we need to add config options specifically for this.   Note that 
invalidateObject will throw if destroyObject does.   An argument can be made 
that in that case (failed destroyObject), we should not decrement numActive 
(since the invariant should be numActive = objects created by the pool - 
objects objects idle in the pool - objects destroyed).  I think this has been 
discussed in the past and I would be +1 for changing this in 2.0, along with a 
similar change to returnObject.

> ObjectPool.invalidateObject(object) should throw an Exception if object is 
> null
> -------------------------------------------------------------------------------
>
>                 Key: POOL-155
>                 URL: https://issues.apache.org/jira/browse/POOL-155
>             Project: Commons Pool
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.0.1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.5.1, 1.5.2, 
> 1.5.3, 1.5.4
>            Reporter: Sebb
>             Fix For: 1.5.5
>
>
> ObjectPool.invalidateObject(object) should throw an Exception if object is 
> null, otherwise the numActive count can get out of synch.
> It's easy to do this by mistake, see:
> http://markmail.org/thread/ya22ihmghejbfzme
> Also, the documentation for ObjectPool needs to be updated to clarify that 
> invalidateObject should only be called if the object failed, not the borrow.
> [I'll do this shortly]

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to