[ZODB-Dev] How to predict George Bailey?

Magnus Lycka magnus@thinkware.se
Fri, 01 Nov 2002 18:12:03 +0100


How can I predict whether an undo operation will cause
objects to be uncreated?

I *could* do something along this line:

1. Before undo, let every window get a copy of the objects
    application specific OID (Not ZODB's.)
2. Undo/commit/sync.
3. Let every open window search for the OID in the database.
4. Close window if OID not found.

I'd prefer if there were fewer steps though. I employ an
Observer pattern, so that Windows close if a displayed object
is removed from another window for instance.

If I could predict beforehand that an undo operation would
G.B. an object, it would be simple for me to close the
affected window. It would also feel safer to loose the
refs to the objects before they get G.B'd.

Can an object see if it's created in the last transaction?


-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se