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

Christian Heimes christian at cheimes.de
Mon Jul 11 08:29:31 EDT 2005


Today I stumbled over an unexpected behavior of savepoints. As far as 
I'm able to understand savepoints they mark a well defined state in the 
middle of a transaction. A savepoint is invalid if its transaction is 
committed or another savepoint is created. Well nesting savepoints would 
be a nice feature but I can live w/o it.

Something else strikes me. Why am I unable to roll back to the same 
savepoint multiple times?

Pseudo code example

 >>> sp = transaction.savepoint()
 >>> dosomething()
 >>> sp.valid
True
 >>> sp.rollback()
 >>> domore()
 >>> sp.valid
False
 >>> sp.rollback()
FunkyRollbackException

 From my point of view I can't see a reason why the ZODB forbids a 
second rolback to the savepoint.

Christian



More information about the ZODB-Dev mailing list