[ZODB-Dev] Savepoints are invalidated once they are used

Dieter Maurer dieter at handshake.de
Fri Jul 15 13:56:45 EDT 2005


Tim Peters wrote at 2005-7-14 19:20 -0400:
> ...
[Dieter]
>> If we do, we can (usually) create a one with the state after the
>> "restore".

[Tim]
>Sorry, I couldn't follow that sentence.

After I have restored to a savepoint "s", then the current state is
the one saved in "s", thus the sequence:

    s.restore() # and eliminate from stack
    s = transaction.savepoint()

essentially recreates "s" and the situation I would get would "restore"
not eliminate "s" from the stack -- modulo the fact, that "s" now
contains a new savepoint object (and other bindings to the old
object no longer work as expected).
An "s.push()" would eliminate this drawback (at the expense of
an additional method).


-- 
Dieter


More information about the ZODB-Dev mailing list