import transaction


Something simple:

s = transaction.savepoint()
s.rollback()

Something less so:

s = transaction.savepoint()
s1 = transaction.savepoint()
s.rollback()

...okay, so we can nest savepoints, yay!

>>> s1.rollback()
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File
 "lib/python/transaction/_transaction.py", line 682, in rollback
     raise interfaces.InvalidSavepointRollbackError
 transaction.interfaces.InvalidSavepointRollbackError

That makes sense, since we already rolled back to before it.

Okay:

s = transaction.savepoint()
transaction.commit(1)
s.rollback()
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File
 "lib/python/transaction/_transaction.py", line 682, in rollback
     raise interfaces.InvalidSavepointRollbackError
 transaction.interfaces.InvalidSavepointRollbackError

wtf?

Chris

--
Simplistix - Content Management, Zope & Python Consulting
           - http://www.simplistix.co.uk
_______________________________________________
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