[ZODB-Dev] Debugging ConflictErrors

Thomas Güttler tguettler at tbz-pariv.de
Thu Jan 15 08:47:21 EST 2004


Hi!

Has someone hints how to debug ConflictErrors?

Up to now I log ConflictErrors like this:

        # First version taken from Dulcinea/lib/ui/publish.py
        retries=15
        for i in range(retries):
            try:
                return Publisher.try_publish(self, request, path)
            except ConflictError, exc:
                obj=self.root_namespace._p_jar[exc.oid]
                print "ConflictError %sv%s: retrying request. " \
                      "path=%s user=%s obj=%s oid=%s" % (
                    i, retries,
                    path, os.environ.get("REMOTE_USER", ""), repr(exc.oid),
                    obj)
                get_transaction().abort()
                request.response = HTTPResponse() # reset response object
                time.sleep(2 + (random.random() * (i+1)))
        else:
            raise RuntimeError("too many conflict errors")

The conflicts always are in my root object. This is
the object which holds all other objects. I use ZODB 3.2

Links to parts of the python code would help, too.

 Thomas

-- 
Thomas Güttler, TBZ-PARIV GmbH, Bernsdorfer Str. 210-212, 09126 Chemnitz
Tel.: 0371/5221217 Fax:  0371/5221216





More information about the ZODB-Dev mailing list