You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2010/04/11 19:58:41 UTC

[jira] Resolved: (POOL-157) GenericObjectPool.setFactory(...) does not destroy idle pool objects with their original factory object.

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

Phil Steitz resolved POOL-157.
------------------------------

    Resolution: Fixed

Fixed in r932962.

> 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
>    Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4
>            Reporter: David Hu
>            Priority: Minor
>             Fix For: 1.5.5
>
>
> 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.
-
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