On 2/16/07, Rob Butler <[EMAIL PROTECTED]> wrote:
Commons pool itself may be OK. It is the underlying pool implementation used by Apache DB Connection Pool (DBCP). I've had problems with DBCP in the past. Specifically I used the connection testing feature to verify connections were still "live". I had this run every 30 minutes or so. There is some bug in DBCP because it closed all my connections every 30 minutes and re-established the minimum number of connections. This caused unnecessary overhead on my DB.
DBCP had major issues a few years ago. in particular, lots of people reported bugs but no one cared enough to volunteer to fix them. only a small number of these bugs were problems with commons pool. the major issue for pool was lack of volunteers willing to work on what is a difficult and pretty thankless area. luckily, sandy stepped up last year and active development restarted.
Commons pool doesn't have a lot of features either, it is a fairly simple pooling implementation.
commons pool is an generic pooling API with a basic implementation. it's extensible so new function can be plugged in.
To the best of my knowledge, there is no JMX support for monitoring
the pool. No way to
safely increase/decrease the pool at runtime and no way to gather pool usage statistics.
this could be added to commons pool by extension
For the core functionality of a pool these things aren't needed, but they are really nice to have. I don't recall the pool having a lot of lifecycle callbacks either. You may want to do something to your pooled objects before/after they are borrowed/returned, or after they have been idle for some time.
commons pool supports this through extension
Also commons pool is rather old. With the new concurrency utilities in Java 5 it might be possible to implement a more performant pool.
in this area mature is usually better than immature. the problem is that there are *very* few developers with the required skills and dedication to maintain good open source pool implementations. it typically take a few days to knock up a pool implementation and then years to properly debug it.
There are numerous pooling strategies/algorithms as well. Commons pool only implements a few (although it does provide an interface to implement your own). There could be a vast array of different pooling strategies people would want to use. Probably more than we could ever think of. So it would be good to provide a way that people can plug in what > they need.
commons pool is a pluggable, extensible generic API. mina could invent it's own pluggable, extensible generic API (and after a lot of argument it would probably arrive at something close to commons pool) but i'm not sure what benefits this would bring. IMHO it would make more sense to add the required features by extension or even better work with sandy to improve commons pool than reinventing the wheel. - robert
