[ZODB-Dev] _p_changed in __setstate__

Dieter Niggeler dieter.niggeler@comit.ch
Fri, 25 May 2001 13:59:10 +0200


Hi,

a persistent class containing a non persistent attribute dictionary
overrides the method '__setstate__(self)' in order to extend the
dictionary by further attributes while loading object's state. To advice
the persistence mechanism to make the object persistent, object's
self._p_changed is set 1, unfortunately this change is lost.
Somewhere in the code between _p_changed is set back to 0 without making
the state persistent. So, how does ZODB know, that object's state
changed in
__setstate__?
Using the class 'PersistentDict' instead of the standard dict works
fine.

Cheers, Dieter