[ZODB-Dev] __setstate__

Magnus Lyckå magnus@thinkware.se
Thu, 28 Mar 2002 21:05:42 +0100


At 14:19 2002-03-28 -0500, Anton Benard wrote:
>On Wed, Mar 27, 2002 at 10:43:49PM +0100, Magnus Lyckå wrote:
> > Are there any particular gotchas or better alternatives?
>
>If you can it is better to run an update script. Exceptions in
>__setstate__ methods get swallowed. Also the code in the __setstate__ is
>run everytime an instance of the class is loaded and it does not set the
>_p_changed flag so the changes will not be commited unless something
>else sets that flag.

Ok. And self._p_changed = 1 in __setstate__ doesn't work? :)

Do I understand correctly that I need to touch every affected object for
the changes made in __setattr__ to persist? Then the __setattr__ trick
seems pretty pointless... :(


-- 
Magnus Lyckå, Thinkware AB
Älvans väg 99, SE-907 50 UMEÅ
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se