[ZODB-Dev] ZEO and commits

Stefan H. Holek stefan at epy.co.at
Mon Oct 27 13:26:07 EST 2003


A state argument basically contains the __dict__ of the object experiencing 
a conflict.

oldState ..... the state of when your transaction started
savedState ... the state another thread persisted since
               your transaction started.
newState ..... the state your transaction attempted to persist
               when it triggered the conflict error.

oldState is here so you have a clean state to start from, savedState and 
newState are the ones competing for "finalState".

Your resolution code may now look something like:

  def _p_resolveConflict(self, oldState, savedState, newState):
    intermediateState = merge(oldState, savedState)
    finalState = merge(intermediateState, newState)
    return finalState

If you cannot resolve the conflict, raise a ConflictError.

hth,
Stefan



--On Montag, 27. Oktober 2003 10:39 +0100 Antonio Beamud Montero 
<antonio.beamud at linkend.com> wrote:

> I suppose I need to use the _p_resolveConflict() method but where I can
> see more examples? The documentation is very short...


--
The time has come to start talking about whether the emperor is as well
dressed as we are supposed to think he is.               /Pete McBreen/



More information about the ZODB-Dev mailing list