[Zope-dev] Conflict errors on startup, revisited

Tim Peters tim.peters at gmail.com
Thu Feb 24 15:41:54 EST 2005


[Paul Winkler]
> ...
> But - duh - my traceback clearly shows the ConflictError
> happens before that, in the call to get_transaction().commit().
> SO I moved the call to app._p_jar.sync() to right before hte call
> to get_transaction().commit().
> Aaaand... no more ConflictError.

Well, that's certain:  the first thing sync() does is abort the
current transaction.  Then of course commit() won't raise an
exception:  sync() threw away all the changes.

> ...
> If nobody objects, I wouldnt' mind checking the fix in anyway :-)

It would be much clearer instead to change the

    get_transaction().commit().

to

    get_transaction().abort()

That would get rid of the ConflictError too, and for the same reason. 
It has the advantage of being obviously insane, though <wink>.


More information about the Zope-Dev mailing list