[ZODB-Dev] Re: POSKeyError in zodb-3.6.0

Chris Withers chris at simplistix.co.uk
Wed Nov 15 03:12:05 EST 2006


Chris Bainbridge wrote:
> Hi Alan,
>>   - You cant just catch ConflictError and pass
> 
> I do conn.sync() at the top of the loop which is supposed to abort the
> connection and re-sync the objects with the zeo server.

Urm, sounds like you're looking for transaction.abort().

Also, be aware of the weirdness that can occur if you run ZEO clients 
without an asyncore loop. These can lead you to need to call .sync()...

>>   - I think you can catch a ReadConflictError and *retry* that is ok.

Eep, in this day and age you shouldn't be seeing any of these ;-)

>>   - But a ConflictError needs to be *retried* manually in your client 
>> code.

Yup, abort the transaction and try again...

> afaik, this may be better coding style, but isn't actually required,
> since doesn't each commit implicitly begin a new transaction?

Urm, the abort and possibly the .sync are absolutely necessary to get 
all the objects back into a sane, consistent state...

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the ZODB-Dev mailing list