commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eddie Post" <>
Subject correct behavior for object pooling ??- > maybe BUG ??
Date Tue, 21 Oct 2003 06:51:27 GMT

I am using Commons Pool and detecting some strange behavior when returning 
the same object two times (in some junit tests). What should be the correct 
behavior ?
I now signal that:
- The first returnObject returns the object to the pool and makes it idle
- The second returnObject removes the object, so it's not idle anymore.
- When I then retrieve two new objects without returning any of them, I 
notice that they are the same :(. I don't think this is the corect behavior, 
as when the code contains some bug and the same object is returned two 
times, the other pool code will also fail.. or not ??

Why is this ?

What I have ?:
I have a GenericKeyedObjectPool and a KeyedPoolableObjectFactory. In the 
factory I only implemented the makeObject method. I pass a Class as argument 
such that I can use only one makeObject method to create different kind of 
object instances.

Please some help on how to solve this ?
Ed Bras

Add photos to your e-mail with MSN 8. Get 2 months FREE*.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message