[OJB-developers] ObjectCache and IdentityFactory
Brought to you by:
thma
From: Florian B. <bf...@fl...> - 2002-03-21 11:40:34
|
Hi! I'm currently investigating how to improve the object cache and how to create a "factory" for Identity objects. The object cache already stores identities and objects in a HashMap, but unfortunately you cannot retrieve the key of a value from a HashMap reasonably. The idea is now to create a "DoubleHashMap" that maps keys to values and values to keys in an efficient way using SoftReferences. Additionally the map could implement things like throwing out gc'd entries and rehashing in a separate thread, so adding objects to the Map would not lead to a long processing time if the map decides that rehashing is needed. Over the last week I've been looking around if there are any implementations of this concept in the net but found nothing. Then I wrote a little prototype to get a better feeling for the requirements and complexity of such a class, but I am not really satisfied with it and it still needs a lot of work until it is stable enough to be used in OJB. Now the questions: - Do you think this approach is valid and is it worth to pursue it - Does anybody know of an implementation of this concept (I known the jakarta project has a somewhat related class, but it is a DoubleTreeMap and we do not need the overhead of sorting the objects). - Does anybody know of junit tests for Map classes I could use for testing this implementation - What else do you think would be needed for such a class If you have any comments or flames on this, don't hestitate to write a message, I'd appreciate any comment. best regards, Florian |