[Zope] Conflict Errors

Richard Jones richard@bizarsoftware.com.au
Fri, 2 Nov 2001 11:30:53 +1100


On Friday 02 November 2001 12:14, Chris McDonough wrote:
> Richard Jones wrote:
> > On Thursday 01 November 2001 17:00, Chris McDonough wrote:
> >
> > I've been looking into the standard setstate() method of Connection - and
> > I have a couple of questions:
> >
> >  1. where is _invalid defined? I grepped the Zope source, and can't find
> > it anywhere. I'm curious as to the meaning of _invalid(None).
>
> Why of course it's the has_key method of the Connection's _invalidated
> attribute (see Conenction's __init__ method)! Remember, this is Jim
> Fulton code.  ;-)

Ah, of course :)


> >  2. _p_independent is a very interesting little method. It's only used in
> > one place, as far as I can tell (BTrees/Length.py). If it truly did do
> > what it says it's supposed to do - state that an object doesn't affect or
> > rely on other objects, then you'd be able to tack a _p_independent()
> > returning 1 onto your classes that use LowConflictConnection. I think. As
> > it is, it seems that it's only checked for the latter statement - that
> > the object doesn't care about the state of other objects.
>
> Sorry Richard, I don't understand that question?

Nor do I. Imagine me backing away slowly :)

Having said that - in our endeavour to kill off all the ConflictErrors in our 
code, we discovered that we had an unnecessay attribute modification deep in 
the code of our shop product display code. That not only caused the 
occasional write conflict, but also slowed our code down considerably. 
Removing the attribute modification has sped our product display time up by 
3x (and the modification was only being done once per display.) So it hasn't 
all been for naught :)


     Richard