[PEAK] Recursive __setstate__ call

Phillip J. Eby pje at telecommunity.com
Sun Apr 18 00:55:20 EDT 2004


At 04:19 PM 4/17/04 +0200, Radek Kanovsky wrote:

>         def setstate(self, ob):
>
>             if self.resetStatesAfterTxn:
>                 # must always be used in a txn
>                 self.joinedTxn
>
>             oid = ob._p_oid
>             assert oid is not None
>             state = self._load(oid,ob)
>             ob._p_jar = _noDM
>             ob.__setstate__(state)
>             ob._p_jar = self
>
>
>
>All my unit tests passed without error so I don't expect some other problems.
>Thanks for help.

Hm.  Do they pass without the modification to setstate()?  I'm just curious 
because I seem to recall that every place the DM' setstate() is called from 
persistence.c, it first temporarily sets the object's state to "CHANGED", 
and then puts it back to "UPTODATE" afterwards.  So it seems like the code 
above in setstate() should be unnecessary.  But I haven't rechecked this.




More information about the PEAK mailing list