[ZODB-Dev] Help: ZODB undo problem

Mike C. Fletcher mcfletch@rogers.com
Tue, 18 Jun 2002 18:57:18 -0400


Hopefully third time is a charm :) ...

I'm trying to add undo functionality to a ZODB-3-based single-user GUI 
application.  I can get the app to undo as long as no window has a 
pointer to an object in the database.  When a window does have a 
pointer, the ZODB complains that there is a serial-number mismatch as 
soon as the window with the old pointer tries to commit.  I would love 
to know:

	1) How to get the "live" objects to update to their previous state when I 
do an undo (very much preferable, as it would save a lot of re-writing)

	2) How to wrap the object in a weakref-like instance that will re-access 
the object from the database when it is un-done, and preferably only 
when it is undone (i.e. something that won't keep the object alive 
outside the cache, but won't constantly be re-loading the object when 
it's not been invalidated).

	3) Why the live objects don't automatically update (I thought this was 
magically done by the ZODB Persistence machinery through the magic of 
the jar and cache structures).

I'd be really happy to have an answer for any of the three, or even a 
pointer to who might be able to answer the question.  This bug has been 
bugging me for weeks (months?) now, and I really need the undo 
functionality before I deliver it for beta-testing (this is for an 
Open-Source Room scheduling application, available here:
	https://sourceforge.net/projects/conflictsolver/
).

Any thoughts appreciated,
Mike
-- 
_______________________________________
   Mike C. Fletcher
   http://members.rogers.com/mcfletch/