[Zope] losing object data

Dieter Maurer dieter at handshake.de
Wed Oct 13 14:19:35 EDT 2004


Jim Anderson wrote at 2004-10-13 08:21 -0400:
>I have had problems with several objects and I suspect the problem
>has to do with storing complex data structures in a persistent
>zope object.
>
>The behavior I see is that when I display the data in the browser,
>sometimes it is correct (most of the time actually), but other times
>it is in it's initial state, as if the object had just been created.

You are almost surely right.

You can verify your assumption as follows:

  *  Flush the ZODB cache (--> ControlPanel --> Database Management
     --> Main --> Flush --> Minimize)

  *  Look again at your object

When the assumption is right, then each "flush" will reset all
your objects -- not necessary to there initial state
but to the last state that were made persistent.

>First, I tried including self._p_changed = 1 in all the object methods
>where the data gets modified.

This should be sufficient -- provided you called it on the
persistent parent of your non-persistent complex data structure...

-- 
Dieter


More information about the Zope mailing list