[ZODB-Dev] ZEO and commits

Antonio Beamud Montero antonio.beamud at linkend.com
Tue Oct 28 08:51:40 EST 2003


Are you saying something like:
 class MyDict(Persistent):
    def __init__(self):
       self._data = PersistentMapping()
    def add(self, id, data):
       self._data[id] = data
    def get(self, id):
       return self._data[id]
    def _p_resolveConflict(self, a, b, c):
       ....

 root['objects'] = MyDict()
 mydict = root['objects']
 mydict.add('nuevo', Register())

 And this code in MyDict will resolve the conflicts?...
I have proved it and doesn't works...
Everytime the object is the root object... I don't want raise Conflicts
in root... :'(

A lot of thanks Christian.


El mar, 28-10-2003 a las 14:29, Christian Robottom Reis escribió:
> On Tue, Oct 28, 2003 at 01:41:42PM +0100, Antonio Beamud Montero wrote:
> > The object hasn't a _p_resolveConflict because is the root object, it
> > only has methods like dictionary has and not like Register object
> > has...
> 
> You've run into a ZODB fact: the root object can't handle conflicts.
> If the question is `What can you do?', the answer is simple: avoid
> generating conflicts in it :-)
> 
> Seriously, avoid storing more than your high-level containers (use
> BTrees if you need a hash-like structure with reduced conflicts, for
> instance, or your own instances if you need something more specialized)
> in the root. Your containers can then handle conflicts however you like.
> 
> Take care,
> --
> Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
-- 
Antonio Beamud Montero <antonio.beamud at linkend.com>




More information about the ZODB-Dev mailing list