Hi, 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. First, I tried including self._p_changed = 1 in all the object methods where the data gets modified. When that did not work, I tried changing the object's lists to persistent Zope objects, or OOBTree. That did not work. Finally, I tried changing the object data to individual ints just to see what would happen. Still the same problem. My question is, am I making a bad assumption and attaching the wrong cause of my problem? I can't think what else might be causing the problem, except possibly the fact that the application is multithreaded. But I'm pretty sure this is not causing the problem because all the data read in by one thread ALWAYS is seen as correct in the other thread, at least until the data is displayed in the browser. Thanks in advance for any suggestions. Jim Anderson
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
participants (2)
-
Dieter Maurer -
Jim Anderson