commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sandy McArthur" <sandy...@apache.org>
Subject Re: [pool] Pool of concurrently shared objects ?
Date Tue, 23 May 2006 16:54:55 GMT
Marc,

Commons Pool is very much geared towards the reuse of heavy weight
objects by one thread at a time. This is because Pool was originally
intended for reusing JDBC connections. There isn't an existing pool
implementation that I know of that implements the behavior you
describe.

I would ask if you're interested in donating your code to future
versions of pool but I don't see how the concurrently reusable
poolable object life cycle fits with the PoolableObjectFactory life
cycle methods. Activating and passivating a connection doesn't quite
make sense if it's concurrently borrowed and what does
getNumActive/Idle mean when an object can be multiply active or idle?

Anyway, if you want to attach your "quick hack" to a ticket we can
point people to it if they need the same unique behavior you're
wanting then that would be cool.
http://issues.apache.org/jira/browse/POOL

On 5/23/06, Marc Carter <MCARTER@uk.ibm.com> wrote:
> I wish to use the the pool interfaces but cannot find the features I need.
>
> commons-pool seems geared towards serial sharing of objects: the pool only
> contains idle objects.  I wish to pool concurrently shared objects.  Let
> me be more explicit.
>
> javax.jms.Connection is designed to be shareable amongst threads and will
> handle multiple "conversations" per connection.  I wish to have a pool of
> Connection objects with settings along the lines
> maxUsersPerConnection and/or maxGlobalConnections.  This would allow a
> limited set of Connections to be distributed (round-robin) to the users of
> the pool and for the connection to be stopped/discarded only when all
> users have relinquished it.
>
> I am writing a "quick hack" of this functionality (still using the
> ObjectPool interface) for my current project.  Is there something better
> or have I not read the docs in enough detail?
>
> thanks,
> Marc
> (ps. first post to these forums.  If I have made some glaring mistake in
> protocol please be understanding!)
>
-- 
Sandy McArthur

"He who dares not offend cannot be honest."
- Thomas Paine

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message