RE: [OJB-developers] ObjectCache and IdentityFactory]
Brought to you by:
thma
From: Mahler T. <tho...@it...> - 2002-03-22 15:55:43
|
Hi Florian, > 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. If I get you right, you want to use the already existing ObjectCache to serve also a Identity cache. That's a cool idea ! <snip> > > Now the questions: > > - Do you think this approach is valid and is it worth to pursue it > Yes !!! > - 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). > in class ObjectEnvelopeTable we have somewhat similar problem that requires to maintain a HashMap and a List to have two independend views on the Table of ObjectEnvelopes registered to a transaction. Maybe you find some inspiration there. My general suggestion: Keep it simple. Better to waste some memory by maintaining two hashtables than building a too difficult solution. Thomas |