[ZODB-Dev] Basic ZODB practices

Hector Sanchez SanMartin Hector.Sanchez at cern.ch
Tue Mar 9 04:42:16 EST 2004


    Hello everybody,

    I'm using ZODB and I need to minimise ConflictErrors in my 
application so I would like to describe my situation and ask for some 
ideas about how could improve it (if possible) in order to minimise 
ConflictErrors as I'm sure you have already faced the same problem.
    So, I have a collection of objects which must be uniquely 
identified. For doing this I'm keeping a simple counter object in the DB 
which gives consecutive ids. These objects need to be retrieved by 
clients from their id so I'm using a OOBTree to hold those objects and 
keep them in the DB, using their id as key.
    My main problem is that the counter object is a concurrency 
bottleneck as for each new object as I need to gather a new id from it, 
thus concurrent counter object modifications provoke a conflict. I could 
certainly solve the conflict using the _p_resolveConflict method but 
this method is only called at commit time and this could provoke that 
two objects get the same id.
    Any suggestion, idea, piece of doc I could refer to in order to have 
some alternative ideas?

    Thanks in advance

-- 
Hector Sanchez

CERN Document Server ** <http://cds.cern.ch/> ** <cds.support at cern.ch>
InDiCo Project       ** <http://cern.ch/indico>
Room: Bldg 2-1-036 ** Voice: +41-22-7677918 ** Fax: +41-22-7678142





More information about the ZODB-Dev mailing list