[ZODB-Dev] Why does transaction.commit(1) break savepoints?

Tim Peters tim.peters at gmail.com
Tue Oct 17 15:12:57 EDT 2006


[Chris Withers]
> ...
> >>> 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?

ZODB NEWS.txt:

- (3.5a4) Subtransactions are deprecated, and will be removed in ZODB 3.7.
  Use savepoints instead.  Savepoints are more powerful, and code using
  subtransactions does not mix well with code using savepoints (a
  subtransaction commit forces all current savepoints to become unusable, so
  code using subtransactions can hurt newer code trying to use savepoints).


More information about the ZODB-Dev mailing list