[Zope3-dev] Re: [ZODB-Dev] ZODB4 project plan

Jeremy Hylton jeremy@zope.com (Jeremy Hylton)
Tue, 26 Nov 2002 15:28:11 -0500


The counter-argument is that a version, while poorly named, provides
the only mechanism for locking objects to guarantee progress for a
long-running operation.  Without versions, the longer an operation
takes the more likely it is to hit a ConflictError.  With versions, a
long-running operation can be structured into two phases.  The first
phase copies all the objects into the version.  The second phase does
the application logic (whatever it is).  When the second phase
finishes, it commits the version.  If the second phase fails, it
aborts the version.

I think that versions add complexity and are poorly named, but are
a valuable feature.  I'd be in favor of changing the feature's name --
perhaps calling it a lock instead of a version -- and rethinking how
it is exposed in the various ZODB APIs.

Jeremy