Comment 7 for bug 98275

Revision history for this message
Christian Theune (ctheune) wrote : Re: [Bug 98275] Re: ZEO versus creative __getstate__

Am Mittwoch, den 10.10.2007, 18:18 +0000 schrieb Jim Fulton:
> 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.

Looking at the code, I understand this: the 'unsaved' state is defined
implicitly and isn't reflected by a status of the '_p_state' attribute
(it is 0 at this time although I can't find the point where this data is
initialized). As soon as the object receives the _p_oid and _p_jar
attributes the '_p_state' (being 0) becomes relevant and therefore the
object is uptodate (which seems to be the same as 'saved').

> I guess we should set the state to
> changed adrer setting the initial _p_oid and _p_jar.

Ah, sounds reasonable to me.

My first guess was that this would be in cPersistence.c, but I couldn't
find a place where it would fit there (I don't know that code well
though).

The other place I can think of to do this would be serialize.py where it
sets the oid and connection (around line 325 on the trunk).

Christian

--
gocept gmbh & co. kg - forsterstrasse 29 - 06112 halle/saale - germany
www.gocept.com - <email address hidden> - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development