[Zope-dev] Nested Transactions

Michel Pelletier michel@digicool.com
Sun, 01 Aug 1999 22:55:42 -0400


Robert Leftwich wrote:
> 
> I have a situation where an operation can be performed that may require
> multiple interactions with the user depending on the information that is
> available. Currently each interaction results in a single transaction,
> but I would like the entire process to be rolled up into one
> transaction, enabling rollback and undo to work correctly and not leave
> the database in an invalid state.

A Version can do this.  In fact, Versions are long running
transactions.  You might have noticed the new link 'Version Managment'
on the control panel about them.

> According to the documentation, calling begin on the Transaction object
> will result in the active transaction being aborted. What I need is
> nested transactions, where calling begin only increments an internal
> count and subsequent commits decrement the count until 0 when the
> transaction is actually committed (i.e. as for most SQL databases).
> Sub-transactions do not help as their behaviour is the same as what
> occurs now.

Versions can contain versions, but you can only work in one at a time. 
This might do what your looking for.

-Michel