[ZODB-Dev] Savepoints are invalidated once they are used
Jim Fulton
jim at zope.com
Mon Jul 11 10:27:23 EDT 2005
Christian Heimes wrote:
> 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.
I agree. This should be changed.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the ZODB-Dev
mailing list