[Zope] ZODB.POSException.ConflictError (in custommade product)

Dieter Maurer dieter at handshake.de
Tue Oct 28 15:13:11 EST 2003

Gitte Wange wrote at 2003-10-26 23:14 +0100:
 > At 18:34 26-10-2003, Dieter Maurer wrote:
 > >If your counter is maintained in the ZODB, the counter should
 > >be a "BTrees.Length" instance. Otherwise, you can use whatever
 > >data structure seems best for you.
 > Sorry Dieter if I'm slow on this but I just don't get it ...
 > At this moment I have a dictionary looking like this:
 > views = {'http://mypage.com/frontpage': 10, 'http://mypage.com/article2': 3}
 > This get's saved into ZODB and - as I understand - causes the ConflictErrors ?

I said: your counter (any one of them) in the ZODB should become
a "BTrees.Length.Length" instance. I thought, this were pretty clear.

 > ...
 > Or is it the entire dictionary that should be some kind of BTrees.Length() ??

A dictionary cannot become a "BTrees.Length.Length" instance.
This would have been pretty clear, if you had a look at this class ;-)

Often, it is less work to look at the code than to ask a question
on the mailing list ;-)

That said: you may want to replace the dictionary by a
"BTrees.OOBTree.OOBTree" instance.
This way, the conflict resolution of "OOBTrees" may prevent
(most) concurrent writes to the mapping (when you add
new entries to the mapping) causing exceptions.
It may not be necessary, though, as you probably rarely add
new entries (usually, you will count in already existing counters).


More information about the Zope mailing list