commons-user mailing list archives

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

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 ?
Regards,
Ed Bras

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message