I don't think it's a bug...
when you retrieve an object its stored in the cache under key something like
classname_primarykey
> For example,  I get object ID 1. 
> I then set its primary key 
> to 0, store
> it, thus creating a new object. 
Now the DefaultCacheImpl has two references on the same object

> Now I try to get object ID 1 
> again, and
> it returns instead the new record I just created, even though 
> it doesn't
> even match the primary key I  just used. 
the cache only looks up the key not the actual_id of an object

I got two solutions for you
1) write your own CacheImplementation which checkes if the key equals the id
field everytime you access an object
2) write a Copymethod for your Objects which really copies yout object.

I would prefer the second way.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to