commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Perroud <killerwh...@gmail.com>
Subject Re: [pool] introducing Enumerations
Date Mon, 18 Oct 2010 06:09:42 GMT
This behavior can also be achieved using the maxIdle parameter :

maxActive : -1 or Integer.MAX
maxIdle : 200 for example

we can thus borrow more than 200 objects, and the 201st will be discarded
once returned to the pool.

So now again, couldn't we achieve the same behavior with only FAIL and BLOCK
?

Kind regards,

Benoit.


2010/10/17 James Carman <james@carmanconsulting.com>

> On Sun, Oct 17, 2010 at 1:20 PM, Phil Steitz <phil.steitz@gmail.com>
> wrote:
> >
> > Yes, but the question is do you really *need* this option, since setting
> > maxActive = -1 effectively accomplishes the same thing.
> >
>
> Not exactly.  The distinction between the two approaches would be more
> obvious at return object time.  With maxActive set to -1 or
> Integer.MAX_VALUE, the maxActive restriction is never reached.  With
> the "grow" strategy (and a reasonable maxActive), the maxActive limit
> can be checked on return and the object can be discarded rather than
> returned to the pool if the pool has been "grown" beyond its maximum
> allowable limit.  Essentially, "grow" turns maxActive into a guideline
> rather than a rule.  With maxActive turned off, your pool can grow
> unbounded.  Of course, maxIdle also comes into play, but you could
> have that turned off too (then you're simply using maxActive to manage
> your pool size).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message