Comment 6 for bug 98275

Revision history for this message
Jim Fulton (jim-zope) wrote : Re: [Bug 98275] Re: ZEO versus creative __getstate__

On Oct 10, 2007, at 12:42 PM, Christian Theune wrote:

> Am Mittwoch, den 10.10.2007, 15:14 +0000 schrieb Jim Fulton:
>> Minor note. The bug is that changes to an object are registered
>> while __getstate__ is being called.
>
> Right. Thanks for pointing this out more explicitly than I did.
>
>> I think the object should remain
>> in the changed state until later. presumably the object is getting
>> into the uptodate state too soon. This analysis is without looking
>> at the code. :)
>
> It looks like this happens because the object is new. When looking at
> the example, an attribute is immediately changed and the state is
> UPTODATE. When the serializiation later calls __getstate__ it is
> UPTODATE as well.
>
> Are new objects always UPTODATE?

New objects are unsaved. During the commit process, the object
becomes uptodate by virtue of getting _p_jar and _p_oid. This state
change is somewhat implicit. I guess we should set the state to
changed adrer setting the initial _p_oid and _p_jar.

Jim

--
Jim Fulton
Zope Corporation