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

Phil Steitz commented on POOL-368:
----------------------------------

I am not sure that a PooledObject implementing AutoCloseable would be useful to 
applications, as PooledObjects are just wrappers used internally by the pool.  
I think this is something best handled by the client.  The PoolableConnection 
class, for example, in DBCP holds a reference to the pool that created the 
connection so it can implement close() with "return me to the pool I came from" 
semantics.  It may be limitation of my imagination, but I don't see how Commons 
Pool itself can be enhanced to do this generically for clients.

> Create Auto-Closing PooledObject
> --------------------------------
>
>                 Key: POOL-368
>                 URL: https://issues.apache.org/jira/browse/POOL-368
>             Project: Commons Pool
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Priority: Major
>
> Please create an {{PooledObject}} that implements {{AutoCloseable}}.  When 
> the pooled object is closed, the wrapped resource is returned to the pool



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to