[ZODB-Dev] revise transaction API
Jeremy Hylton
jeremy at alum.mit.edu
Mon Jun 14 07:58:56 EDT 2004
On Sat, 2004-06-12 at 11:38, Christian Robottom Reis wrote:
> On Tue, Mar 30, 2004 at 10:25:44AM -0500, Jeremy Hylton wrote:
> > > - It would be nice to see the equivalent of savepoint in 3.3..
> >
> > since commit(1) and abort(1) should be functionally equivalent, I don't
> > think we'll get savepoints in 3.3.
>
> Are they indeed functionally equivalent, though? The point I was trying
> to make is that commit(1) and abort(1) are "single-step savepoints".
> IOW, you can't have a chain of commit(1)s and abort(1) to the
> intermediate steps -- abort(1) reverts to the point indicated by the
> last commit(1) mark, and multiple calls to abort(1) after that are
> effectively NOPs.
You're right. I misunderstood the abort behavior of multiple
commit(1)s.
> Having real, multiple savepoints would be a great feature and would
> allow longer-running transactions a lot more flexibility in what sort of
> manipulation they can do on their objects. A wizard-style UI is a good
> usecase for this feature: you'd like to be able to undo changes as the
> user moved back, and you can't really commit()/abort() the entire
> transaction without risking "logical corruption" in your application.
I think it's useful for a lot of cases. Someone had volunteered to work
on a patch that ported this feature from ZODB 4. Don't know if this
ever happened (and probably don't have time to review it myself).
Jeremy
More information about the ZODB-Dev
mailing list