commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Muldoon <...@firstbest.com>
Subject Re: [Pool] Looking for best approach to seed GenericObjectPool
Date Wed, 04 Apr 2007 14:51:06 GMT
Currently timeBetweenEvictionRunsMillis is set to 30 minutes (which I 
may in the end reduce) and rather than wait 30 minutes for the Evictor 
thread to ensure min idle objects, I decided to add logic to borrow and 
subsequently return minIdle objects at system startup. It seems to 
accomplish what I'm looking for but I'd still appreciate it if anyone 
has a better approach.

Tom

Tom Muldoon wrote:
> I'm using Commons Pool 1.3 and I'm looking for the best approach to 
> seed, or initialize, a GenericObjectPool instance during application 
> server (JBoss) startup.  It appears to me that setting minIdle alone 
> will not do the trick. Apparently, I need to set 
> timeBetweenEvictionRunsMillis (to a positive integer) since the 
> Evictor thread will not start immediately (and it is the Evictor 
> thread that will ultimately ensure minIdle instances reside in the 
> pool). But herein lies the rub. I don't want to set the 
> timeBetweenEvictionRunsMillis to be less than 30 minutes and I don't 
> want to wait until 30 minutes has passed before the pool is seeded. I 
> have implemented a  GenericObjectPool  subclass and I am considering 
> invoking startEvictor with a relatively small delay to seed the pool 
> followed by a call to setTimeBetweenEvictionRunsMillis (when the 
> subclass is instantiated) but that feels like a hack. So, anyone have 
> a better way?
>
> Thanks in advance,
>
> Tom
>


---------------------------------------------------------------------
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