Bugs item #613214, was opened at 2002-09-23 16:11 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=613214&group_id=22866
Category: JBossServer Group: None Status: Open Resolution: None Priority: 9 Submitted By: Christian Riege (lqd) Assigned to: Nobody/Anonymous (nobody) Summary: equals is wrong on Local Interfaces Initial Comment: hi, there's something really rotten in the JBoss world regarding local interfaces: when I do a check for equality between two local interfaces of Bean A and Bean B , this check returns TRUE when the beans have the same PK (although they have totally different classes and underlying DB tables). This only happens on local interfaces, remote interfaces work just fine. Testcase and sources is attached. Put testcase.jar in your deploy directory; then do 'java test.Test' to see output in server console. JDK 1.4.0_02 OS: Win2k & Linux Affected JBoss Versions: 3.0 CVS, 3.2 CVS and 4.0 CVS ---------------------------------------------------------------------- >Comment By: Christian Riege (lqd) Date: 2002-11-27 15:45 Message: Logged In: YES user_id=176671 well, i would expect that when I obtain two Entity Beans from the same home with different PK's that the equals() operation returns true only if their PK is the same. but that is not the problem. Beans obtained from different homes should _never ever_ return true on an equals operation IMHO: after all a java.lang.String will never return 'true' on an equals operation with e.g. a java.util.Collection. but this is the current behaviour in case their PK's match. ---------------------------------------------------------------------- Comment By: Seth Sites (thesitesman) Date: 2002-10-17 23:24 Message: Logged In: YES user_id=579275 >From EJB 2.0 Spec Section 9.8.5 Page 120: if a client obtains two entity object references from the same home, it can determine if they refer to the same entity by comparing their primary keys using the equals method. I think the important part here is "from the same home". Your testcase involves comparing object references obtained from different homes. This behavior is not addressed in the spec, and therefore is undefined. Maybe we should check, but if you obtained it from the same home, like the spec clearly addresses, then the behavior will be correct. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=613214&group_id=22866 ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
