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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]