commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sol myr <>
Subject Commons Pool: can you limit the sum of (active+idle) objects ?
Date Sun, 25 Sep 2005 12:06:49 GMT
Our application requires a pool, and we consider using Jakarta's Commons Pool.
However, i'd appreciate any hints on the following:
Now, if I understand correctly (from the source code), the pool distinguishes between :
- Idle objects: ones that are pooled (un-used, waiting to be borrowed)
- Action objects : ones that were borrowed , and not yet returned to the pool.
I further saw that you can put *separate* limits on each of those, e.g:
* number of idle < 100
* number of active <100
However, what I need is a limit on the *sum*, something like:
 (idle + active) < 200
Of course, this is not the same as limiting each factor separately ...
Is there an easy way to do it with the commons pool ? Or is it an un-supported feature which
I'll need to implement myself ?
(of course it's not so hard to write the whole thing from scratch... but I thought it would
be nice to take advantage of the exising jakarta pool if possible).
Thanks :)

Yahoo! for Good
 Click here to donate to the Hurricane Katrina relief effort. 
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message