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

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to