November 24, 2009

On ZODB conflict resolution

ZODB conflict resolution is a build-in mechanism of the ZODB for resolving (write) conflict errors. Applications can implement application-specific conflict resolution handlers by providing their own _p_resolveConflict() implementation. Most people do not know that conflict resolution with a ZEO environment is carried on the ZEO server and not on the ZEO clients. This implies that related application code must be available and importable by the ZEO server. The bin/zeoserver control file generated by the plone.recipe.zope2zeoserver recipe for zc.buildout does not include your Zope products and other modules within the sys.path and PYTHONPATH of the control file. However there is an easy way to include other packages (as eggs) with sys.path and PYTHONPATH. You just have to use the (undocumented) eggs option within the ZEO server part of your buildout.cfg:

parts = zeoserver
eggs = ...

recipe = plone.recipe.zope2zeoserver
eggs = ${buildout:eggs}