[ZODB-Dev] Re: self.length._p_deactivate() and MVCC

Casey Duncan casey at zope.com
Fri Apr 30 13:08:31 EDT 2004


On Fri, 30 Apr 2004 12:52:49 -0400
Jim Fulton <jim at zope.com> wrote:

> Casey Duncan wrote:
> > On Fri, 30 Apr 2004 11:40:11 -0400
> > Jeremy Hylton <jeremy at alum.mit.edu> wrote:
[..]
> But they are intended for situations where a high-fidelity cache of
> the length isn't needed.  They were originally added to support UIs
> that want to show things like the number of objects in a collection.
> 
> This intention should really be documented in the length class.
> 
> Perhaps there should be different flavors of Length to support
> different needs.

Yes, I think I will implement one that is not "independent" for use when
consistency is desired. I am using Length in my own app where
independence is not desireable (and I have the luxury of ZODB 3.3).
 
> > One possible solution to this might be to drop _p_independent for
> > Length, or create a variant that does not use it. With MVCC,
> > presumably the only thing you would need to handle is write
> > conflicts, and theses are already taken care of in Length.
> 
> Yup.
> 
> Of course, this will defeat your optimization.

Which probably means we should not change Length, or maybe the
optimization isn't all that important. I guess it would be useful to
hear from others using Length in their apps. You are right that the
places it is used in Zope are primarily to support UI, in that case the
change won't hurt (or help) AFAICT.
 
> > Anyone care to poke holes in that idea?
> 
> Nope. In any case, the sementics and tradeoffs should be more
> carefully spelled out.

Yes, as always.

-Casey



More information about the ZODB-Dev mailing list