After having read to serveral informations about jcs, i found it is 
preferred to use strings instead of objects for cached object keys.
As it seems that the string representation of Identity objects is
unique, it should seems better than the jcs cache implementation
uses these strings instead of Identity objects.

Cheers,

Guillaume

-----Message d'origine-----
De : Guillaume Nodet [mailto:[EMAIL PROTECTED]
Envoye : mercredi 31 mars 2004 09:23
A : OJB
Objet : OJB and JCS



Hi !

I'm trying to use JCS for the cache layer in 
OJB and encountered the following problem:
the hash code of the Identity object is computed 
using the hash code of the top-level class
of the real subject. The problem is that the
hashCode() method  of the Class object is not
overrident so that it depends on the internal
state of the jvm and is not the same across
different jvms.  So when serializing the Identity
object to send to JCS, the hashCode is serialized
along with the object (it is part of it for performance
reasons) and the cache is messed up, because another
jvm could have computed another hash code for the same
object.

Could the m_stringRepresentation and the m_hashCode 
attributes of the Identity class could be made transient,
so that they are not serialized with the Identity ?

Thanks,

Guillaume Nodet

---------------------------------------------------------------------
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]

Reply via email to