[ZODB-Dev] Undo in run-time

Magnus Lycka magnus@thinkware.se
Mon, 28 Oct 2002 22:56:01 +0100


Ok, assuming that I get exceptions for all "bad" objects,
at least a part of the problem is solved, but not all I
fear... (Although I *am* very happy if I don't risk little
database inconsistencies that go unnoticed for long...)

What about objects that haven't changed during the undone
transaction? Are they ok to use even though they've been
alive while I did undo, closed the connection to ZODB and
opened it again? Or do I need to get them from the database
again?

Do I have to close and open ZODB? The Zope Bible p 410 says:
"Note that you won't notice any changes until you commit
the transaction and open a new connection to the database."
But then they show an example where we see the revival of
a deleted object without reconnecting...

Also, is there a way to test that an object is out of sync
with the database or do I need to provoke things with a
commit and exception handling? (Would that work? Would the
offending object be located?)

Is there a way for an object to "refresh" itself from
the database? (Assuming that I could somehow "broadcast"
some signal to each live object.) Is there any certain way to
get rid of the GB'd objects in python? Other than to find
all references manually and delete them one by one? :(
(Maybe I should have used weakref everywhere...)

I have a fairly clean separation between GUI and logic.
One solution could be to take this one step further and
make the app client server (just local and one to one
right now, but with GUI and logic running in different
processes). Then I could shutdown and restart the logic
process, while the GUI stays up. I might have to close
GUI windows that are made obsolete, but otherwise things
can look stable at least...

If I would take the client server approach: Any good
suggestions on how? XML-RPC? PyRO? CORBA?


--=20
Magnus Lyck=E5, Thinkware AB
=C4lvans v=E4g 99, SE-907 50 UME=C5
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se