[ZODB-Dev] conflict resolution for PersistentList

Diez B. Roggisch d.roggisch at ehotel.de
Mon May 24 09:20:20 EDT 2004


>
> Are you sure that the conflicts you care about are in this parent
> object?  Without knowing anything about your application logic, I would
> guess that items is modified more often than its parent.  If so, you
> need an _p_resolveConflict() method on items, not on the parent.  You
> could accomplish that by subclassing PersistentList and adding the
> _p_resolveConflict method.

The problem is that the list of items itself creates the conflict - in my 
older post I said that the list of items in parent is modified concurrently - 
new items are created and appended to the list. Then the conflict arises 
inside the list itself. 

Having a _p_resolveConflict on UserList didn't help me as it doesn't get 
called, while having one at Parent gets called but contains the pickled 
version as state - nothing I can work with.

Maybe the solution to this problem is to use a mapping as storage, not a list, 
and a synchronized key generator - bet what happens when two mappings like 
this:

{0: OldItem, 1:OldItem, 2: NewItem, 4: NewItem}
{0: OldItem, 1:OldItem, 3: NewItem, 5: NewItem}

are commited after each other? OldItem shall denote that the item has been in 
the mapping before the current tratnsaction.

Regards,

Diez



More information about the ZODB-Dev mailing list