On May 25, 2004, at 1:30 PM, Pier Fumagalli wrote:On 25 May 2004, at 11:22, Ugo Cei wrote:Pier Fumagalli wrote:
I seriously think (I can't see it but can definitely smell it) that it happens because one of those handlers (somehow) gets recycled, and it's reused before it's actually fully disposed...
So, I _seriously_ think that by fixing the problem adding the appropriate synchronizations, we'll not solve a deeper bug somewhere in the pools...
I am more and more inclined to think that pooling is harmful more than it is useful. Components shouldn't be pooled by default, only on special occasions and after careful consideration. Apparently, doing a bug-free pool is harder than it seems.
Oh, well... I totally agree with you on this... Especially since the JVMs got quite a lot faster in the last few years... Pooling JDBC connections is one thing, pooling random objects another.
But, again, you should consider that in quite a few occasions you're pooling coonfigured & initialized objects. It's not just creation overhead: at times configuration can be a complex beast to manage, leading to heavy processing times.
If they are such beasts to configure, then they should also be made thread safe, and used as singletons...
For example, in JAXP, the "Template" is ThreadSafe, and can be used as a singleton by a bunch of "Transformer" instances all "configured" with the same stylesheet...
If you need to pool non-thread-safe object instances, then (IMVHO) you're doing something _REALLY_ wrong! :-P
ANYHOW...................
- O - O - O - O - O -
I patched Excalibur, and Bertrand is checking out if my patch solves also his bug... Now, if my patch works, given that this is not a bug in our code, how do we go in sticking that into the Excalibur CVS and re-release now that community of that project has collapsed?
Pier
smime.p7s
Description: S/MIME cryptographic signature
