Ned Wolpert a �crit :
>
> On Thu, 2001-12-20 at 11:24, florian ramillien wrote:
> ...
> > So I have tried to change the Vector in a Hastable with the 'object'
> as
> > key and 'entry' as value.
> > But 'object' is modified when it's loaded from DB, when user update
> one
> > of it's attributs, etc ..
> >
> > If 'Object.hascode()' is not redefined. The value returned is
> "typically
> > implemented by converting the internal address of the object into an
> > integer" so it's a constant for one Object.
> >
> > But if it's redefined and depend on attributes of the Object (to be
> > consistent with 'equals()' for example), object's hashcode can change
> > between two acces on the Hashtable, and for the Hashtable there's now
> > two differents objects.
>
...
>
> So, from a fundemental level, if the hashCode() isn't changed, we're
> close to that object-unique address anyways. If we can make sure we
> call the native hashCode() we're set. (Note that things like Boolean
> override its, which seems odd to me, but something to be wary of.)
>
Actually, I don't know methods to get a constant unique identifier for
a Object. But we can use a unique identifier for Persistent object. This
is 'object's class' + 'primary key'. So perhaps we can use this as key
for the Hashtable ?
In mailing list, we can see sometimes reference to a refactoring of
Castor. Is this refactoring modifying this performance problem ? Maybe
Thomas Yip or a Castor Developer can give you some advice on This ?
> When you did you tests, did you see the problems you mentioned? Or did
> you extrapolate this on what could happen if the hashCode() was
> overriden?
>
Yes, I have this problem ...
Thanks,
Florian.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev