> the EJB 2.0 spec, section 9.8: > > "The result of comparing two object references using the Java > programming language Object.equals(Object obj) method is unspecified. > Performing the Object.hashCode() method on two object > references that represent the entity object is not guaranteed > to yield the same result. > Therefore, a client should always use the isIdentical method > to determine if two entity object references refer to the > same entity object." > > This seems to indicate that hash-backed collections of local > object references are not guaranteed to behave properly. If > this is the case, is there any safe workaround?
If the implementation relies on untrusted hashCode() and equals() then no. In JBoss, equals() will call isIdentical() and hashCode() will return pk.hashCode(). That means, for two EJBLocalObject a1 and a2 representing the same persistent data and a1 != a2, the following is true: a1.equals(a2) == true a1.hashCode() == a2.hashCode(); ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user