[ZODB-Dev] Re: [Zope] ZODB.POSException.ReadConflictError

Christopher N. Deckard chris@globalfoo.net
Wed, 8 Jan 2003 07:11:24 -0500


Originally posted to zope@zope.org.  Suggested I try here.

On Wed, 08 Jan 2003 09:20:38 +0000, Chris Withers spoke forth:

> Christopher N. Deckard wrote:
> > I get errors like this a lot:
> > 
> > Error Type: TALESError                                          
> >    
> >  file Error Value: ZODB.POSException.ReadConflictError on
> >  database
> > read      :   conflict error (oid 000000000013d150, class
> > BTrees.IOBTree.IOBucket)  pic0 in "", at line 48, column 17    
> > 
> > I have a script that queries a ZCatalog and returns the list
> > from the query.  There are about 2,000 objects cataloged.  The
> > objects are ZCatalog aware, so they auto-update the catalog when
> > changed. Whenever this is happening during the query, I get the
> > ReadConflictError.  
> 
> Do your queries take a long time to execute? How about your
> updates?

The queries can take some time to execute yes.  The updates are also
not the most efficient yet.  The objects are of a type from a
Product that I wrote.  The date is accessed like on a Folder except
that it is stored in XML.  During an update, a dictionary based
cache is created of all of the "properties" and their data.  My
catalog that indexes all of these objects (one catalog is around
2000 objects, the other about 10,000+ objects) takes a while to
index an object because I have indexes and metadata for most of the
properties that any of the objects have.  There are roughly (without
counting exact numbers) 50 indexes and metadata.  I know it's not
the most efficient thing to do, but I need to be able to search on
everything and have all of the metadata available.

> > I'm using ZEO on a single machine.  I've tried with multiple ZEO
> > clients, but still get the same results.  Is there anything I
> > can do in my Product to prevent this from happening?  Maybe
> > something else I can configure?
> 
> Not really. The idea behind ReadConflictErrors is that your update
> may have changed some data which the query is then trying to use,
> but this may not be consistent which the rest of the information
> your query has already used, so the error is raised.

It'd be neat if the old copy of the object and catalog were
available until the update transaction was completed.  Then the new
ones could be put in.  I don't know the details in how updates are
handled in the ZODB though.

Thanks,
-Chris

> The gurus over at zodb-dev@zope.org may be able to help...
> 
> cheers,
> 
> Chris