db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [jira] Updated: (DERBY-243) connection toString should uniquely identify the connection
Date Mon, 02 May 2005 16:35:32 GMT
Jack Klebanoff wrote:

> If the Derby client absolutely requires that its Connection class
> toString methods return unique, that is if the client would fail to work
> if toString() were not unique, then we could toString could not use
> identityHashCode. However, I do not believe that this is the case. I
> think that uniqueness is very helpful but not required.
> 
> It is true that identityHashCode is not guaranteed to be unique.
> However, in practice it almost always is unique.

I'm not sure about that. If the identity hash code maps to a memory
address then the fact that the object's hashcode has to remain fixed
over time and objects can be moved in memory mean that two objects could
 end up with the same hash code. Ie. the are created at different times
but at the same address, since the first object created has been moved.

Dan.



Mime
View raw message