Message: A new issue has been created in JIRA.
--------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/xdoclet/secure/ViewIssue.jspa?key=XDT-397 Here is an overview of the issue: --------------------------------------------------------------------- Key: XDT-397 Summary: PK hashcode value will be lost when serializing Type: Bug Status: Assigned Priority: Major Time Spent: Unknown Estimate: 0 minutes Project: XDoclet Component: EJB Module Versions: 1.2 Assignee: xdoclet-devel (Use for new issues) Reporter: Lennart Petersson Created: Fri, 21 Mar 2003 7:57 AM Updated: Fri, 21 Mar 2003 7:57 AM Description: > Looked in template for pk from 1.2b2 that hashCode() is used in > the > same way as in the old ejbdoclet that we still use. We recently > had a > problem with this implementation. > > Hashcode is initiated to Integer.MIN_VALUE and calculated only if > the > cached hashcode is equal to Integer.MIN_VALUE. And that works ok > as > long as the PK stays within a JVM. We had a situation where this > didn't > work that well. JBoss uses the PK as a key in internal entity > caches. > We had a situation where a PK was sent within a bigger dataobject > to a > client JVM. There some entity fields where changed and then sent > back > to the server. What happened during the deserialization was that > the > transient hashcode was initiated to 0 and hence never recalculated > since it differed from Integer.MIN_VALUE. Back on the server a > findByPrimaryKey was issued using this 'incorrect' PK which > resulted in > a load from database and a second instance of the same entity in > cache. > We solved this in our ejbdoclet by changing hashcode to be > initiated to > 0 instead of Integer.MIN_VALUE. Could also be done by extending > the > check if hashcode should be calculated to include test if it is 0. > > Whats your oppinion about this? I think the change should be > implemented in current codebase. > > /Lennart Also covered int this thread: http://sourceforge.net/mailarchive/forum.php?thread_id=1861801&forum_id=1106 --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/xdoclet/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel