[ZODB-Dev] Re: false write conflicts
Casey Duncan
casey at zope.com
Tue Mar 2 09:15:04 EST 2004
On Mon, 01 Mar 2004 23:42:55 -0500
John Belmonte <john at neggie.net> wrote:
> Casey Duncan wrote:
> > Are you using augmented assignment operations with the subobjects?
> > At some point the object in question is being marked as changed. It
> > might be worthwhile to instrument ZODB to tell you when the object
> > is being marked changed (and added to the transaction). That'd be
> > one way to track it down.
>
> I am using augmented assignment, does that cause problems?
Augmented assignment causes a setattr on the containing object. This is
the way Python works. These examples are semantically equivilant::
self.x += 1
self.x = self.x + 1
setattr(self, 'x', self.x + 1)
They all cause self to be modified through __setattr__. If self is a
persistent instance then it will be marked changed in all three cases
above.
-Casey
More information about the ZODB-Dev
mailing list