commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Hu (JIRA)" <j...@apache.org>
Subject [jira] Commented: (POOL-157) GenericObjectPool.setFactory(...) does not destroy idle pool objects with their original factory object.
Date Wed, 10 Feb 2010 22:08:28 GMT

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

David Hu commented on POOL-157:
-------------------------------

I have no use case for it. I just noticed it while trying to understand the code.

> GenericObjectPool.setFactory(...) does not destroy idle pool objects with their original
factory object.
> --------------------------------------------------------------------------------------------------------
>
>                 Key: POOL-157
>                 URL: https://issues.apache.org/jira/browse/POOL-157
>             Project: Commons Pool
>          Issue Type: Bug
>            Reporter: David Hu
>            Priority: Minor
>
> When setting a new object factory, the existing idle poolable objects are not destroyed
by the same factory that created them.
> 1453	    public void setFactory(PoolableObjectFactory factory) throws IllegalStateException
{
> 1454	        List toDestroy = new ArrayList();
> 1455	        synchronized (this) {
> 1456	            assertOpen();
> 1457	            if(0 < getNumActive()) {
> 1458	                throw new IllegalStateException("Objects are already active");
> 1459	            } else {
> 1460	                toDestroy.addAll(_pool);
> 1461	                _numInternalProcessing = _numInternalProcessing + _pool._size;
> 1462	                _pool.clear();
> 1463	            }
> 1464	            _factory = factory;
> 1465	        }
> 1466	        destroy(toDestroy); // <----- indirectly calls _factory.destroy(...)
when _factory has already been replaced by the new factory.
> 1467	    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message