Transaction Isolation, was Re: SystemSpecifyer, was Re: [ZODB-Dev] How to predict George Bailey?

Magnus Lycka magnus@thinkware.se
Mon, 04 Nov 2002 16:10:50 +0100


At 12:24 2002-11-04 -0200, Christian Reis wrote:
>It also shows that there is an issue with Undo, because if you just
>blindly Undo you can't be sure you are undoing changes that were done to
>that specific *part* of the application or to something completely
>different.
...

Personally I don't see a poblem with this. At least not now.
In the future SystemSpecifyer might well be extended to work
with several systems at the same time, and then I might perhaps
see such a need.

Conceptually, one might well imagine that I perform the steps
A, B, C, D, and I realize that B was wrong, and should be
undone. It would be difficult to know if C and D depend on
B though, so I think it's reasonable that the user will have
to undo C and D as well, or repair whatever was wrong with B.

It might be some work for me to define transaction boundries
better than today, but I'm sure this can be done. Then it would
be clearer in what steps I can undo things. Maybe I could use
the message parameter to the commit to save some info that
will help me with undo?

The problem I see is the issue with dangling references to
George Bailey'd objects on Undo, but maybe I should read up
on the previous threads on that issue to see if there is
more here than I thought.

I just thought about another issue though... And maybe this
is the solution to the entire problem. If I delete an object,
and that leads to a closed window, and I undo that operation,
the window ought to reappear. Maybe I should do:

get_transaction.commmit(
  list_of_currently_open_windows_and_objects_they_refered_to)
every time I do a commit.

When I undo, I would restore this set of windows, and close
any others. Maybe this would work?

Eventually I'll use ZEO and a multi user setup I guess. Then
I'm sure there will be all sorts of concurrency issues to solve.
Undo will certainly be more complicated then. It seems difficult
to allow undo of something that has been made available to other
users in the system. Might sub-transaction ne helpful here?


-- 
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