commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Maring <>
Subject [Pool] clustering and seeding
Date Fri, 19 Sep 2003 12:36:59 GMT
I've created a synchronized factory that is
responsible for creating object pools and returning
pool instances to clients wanting to borrow objects
from the pool.  However, I was wondering if anyone
could comment of best practices for seeding and

Some of my pools contain objects that represent the
result sets of common long running queries.  Of
coarse, if the pool receives multiple requests to
borrow objects out of these pools before a makeObject
can complete, I see an explosion of resources while
all the requests end up running makeObject and
ultimately end up throwing away most of those objects
from the pool once things cool down.  I'd like to
prime the object pool in the same synchronized method
that creates the pool.  However, executing a number of
threads to borrowObject in order to seed the pool
seems a bit odd.  Is there a more elegant way to
invoke the makeObject?

I'm deploying these object pools into a clustered J2EE
app.  Therefore, every node in the cluster ends up
with it's own object pool.  This is not a terrible
thing for non-keyed object pools, but makes the notion
of a KeyedObjectPool seem kind of silly.  Can anyone
recommend a strategy for singleton object pools across
a cluster?

Many Thanks.
Steve Maring
Tampa, FL

Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message