[Zope-ZEO] ZODB database corruption under multiple connections
Jim Fulton
jim@digicool.com
Fri, 19 Jan 2001 14:39:29 -0500
Lennard van der Feltz wrote:
>
> Jim Fulton wrote:
>
> (snip)
> >(Note that in the version of the software you have, the assignment wouldn't
> >raise a conflict error, because conflicts were only checked during commits.
> >Earlier, I checked for conflicts when reading state from the database. I
> >incorrectly removed these checks because they could lead to conflict errors
> >on read transactions, which seems silly. Unfortunately, the check was
> necessary
> >to avoid reading inconsistent data and the read checks have recently been
> added back.
>
> Although I didn't encounter conflict errors on read transactions in my test
> scripts, there were several that occurred in my regular code after I
> implemented the new Connection.py. Can you give any pointers how to predict
> when the might happen and what defensive coding techniques to use to avoid
> them?
Sync often and avoid hot spots. Zope is an extreme case, because it
reopens connections for each web request. Think it terms of the
sort of minimal reasonable units of computation and sync then.
Note that syncronization happens implicitly whenever a connection is
involved in a write.
Jim
--
Jim Fulton mailto:jim@digicool.com Python Powered!
Technical Director (888) 344-4332 http://www.python.org
Digital Creations http://www.digicool.com http://www.zope.org