[Zope] using _p_resolveConflict on Folderish object

Stefan H. Holek stefan@epy.co.at
Sun, 29 Dec 2002 19:09:15 +0100 (CET)


Just in case you haven't yet make sure to read this:
<http://www.zope.org/Members/jim/ZODB/ApplicationLevelConflictResolution>

To answer your question, savedState and newState are the ones competing
for "final" state. Do not get confused by the (badly chosen) parameter
names ;-). Your job is to resolve this conflict by e.g.

intermediateState = merge(oldState, savedState)
finalState = merge(intermediateState, newState)
return finalState

Stefan


On Sun, 29 Dec 2002, Willem Broekema wrote:

> Hi all - I'm trying to resolve ConflictErrors in my Product. It might be
> relevant that the product is derived from 'Folder'.
>
> I created a '_p_resolveConflict' function that prints the three state
> parameters, 'old', 'saved' and 'new'.
>
> I was surprised to see that the printed representation of the three
> states was identical: the data inside 'PR(...) was the same for every
> subobject. Also, 'oldstate == savedstate' was true, but not 'oldState ==
> newState' or 'oldState is savedState'.
>
> I would like to know what's going on here. For example, if 'oldState ==
> newState', can I safely assume that newState is correct and there's no
> need to merge changes (which changes?) between oldState and savedState?
>