Thanks Stephen. Here is the ticket: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26503.
All the Best, Andy ----- Original Message ----- From: "Stephen Colebourne" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Wednesday, January 28, 2004 3:18 PM Subject: Re: [collections] new feature request: org.apache.commons.collections.map.ReferenceMap (WeakIdentityHashMap) > The ideal solution IMO would be for ReferenceMap to extend the new > AbstractHashedMap class. I wanted to do this but ran out of time before 3.0. > If this was done, the identity part becomes natural in the same way as the > IdentityMap works. > > The alternative solution is to just tweak ReferenceMap as you are > suggesting. I reckon the best thing to do is to open a bugzilla ticket and > attach your code, so we can see. > > Whatever, it seems like a good addition. > > Stephen > > > ----- Original Message ----- > From: "Andy Malakov" <[EMAIL PROTECTED]> > > I would like to ask your opinion on providing WeakIdentityHashMap features > to ReferenceMap. > > > > > > Object cache is often implemented using ReferenceMap (WeakHashMap). This > class delegates decision on when to de-cache an objects on > > Java GC. > > > > In many systems Java objects that represent database instances use > database identity: methods Object.equals(Object) and > > Object.hashCode() are redefined to use database identity (identity defined > in terms of object table + object primary keys). > > > > When traditional java.util.Map is used to implement database caches > different instances of the same database objects present a > > problem: instances override each other. Class java.util.IdentityHashMap > (Apache Collections 3.0: IdentityMap) can be used to solve > > this problem - this approach uses System.identityHashCode() to obtain > reference hashCode and Java comparison operator to compare > > keys (and values). > > > > What I need is functionality of IdentityMap combined with > WeakReference-based keys. > > > > Is it possible to extend ReferenceMap with an ability to use reference > identity instead of object identity? I can send you my > > prototype if you are interested (it adds about ten lines of code to > ReferenceMap). > > > > > > > > Here are some links to Sun's bug parade pages that describe similar > feature request for Java's java.util.WeakHashMap: > > > > http://developer.java.sun.com/developer/bugParade/bugs/4809420.html > > http://developer.java.sun.com/developer/bugParade/bugs/4500542.html > > > > P.S. There is a need for this feature in Apache DB-OJB project. > > > > All the Best, > > Andy > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]