openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (OPENJPA-2043) OpenJPAId hashCode() value needs to be consistent after serialization process
Date Tue, 23 Aug 2011 16:37:29 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-2043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Albert Lee resolved OPENJPA-2043.
---------------------------------

    Resolution: Fixed

> OpenJPAId hashCode() value needs to be consistent after serialization process
> -----------------------------------------------------------------------------
>
>                 Key: OPENJPA-2043
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2043
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 2.1.2, 2.2.0
>            Reporter: Albert Lee
>            Assignee: Albert Lee
>            Priority: Minor
>             Fix For: 2.2.0
>
>         Attachments: OPENJPA-2043.patch
>
>
> OpenJPAId class uses the hashCode value "based on the least-derived non-object class
so that user-given ids with non-exact types match ids with exact types".  I.e. least-derived-non-object-superClass.class.hashCode()
> The hashCode of a .class object is not deterministic since it is implemented in native
code. It may change from run to run, jdk or platforms. This scheme works well and is dependable
only within the same jvm invocation, however if the OpenJPAId class is used as a hash key
in distributed application environment, the hashCode may evaluates to different value between
the client and server invocation.
> In a typical distributed caching scheme, the cache key is used as a discriminator to
determine the partition where the cached key/value is located. If the client and server compute
the key to different value, the distributed caching mechanism will fail.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message