[ZODB-Dev] Is any function called when an object is loaded from the database?

Vincent Pelletier plr.vincent at gmail.com
Tue Jun 19 20:20:01 UTC 2012


Le mardi 19 juin 2012 20:50:55, Marius Gedminas a écrit :
> Yes, you can override __setstate__:
[...]
> It's also best to avoid write-on-read semantics, because those tend to
> cause database growth and increase the chances of getting ConflictErrors.

This is also a problem with __setstate__, and I've been bitten by it when 
moving from Zope 2.8 to 2.12 (maybe 2.11 too ?) as 2.8 PythonScript objects 
were modified on load on the new version (adding a trailing \n IIRC), which 
broke "History" ZMI tab: one cannot alter a non-current object revision.

-- 
Vincent Pelletier


More information about the ZODB-Dev mailing list