[Zope-dev] ZODB.POSException.ConflictError on attribute assignment

Michael Dunstan michael.dunstan at gmail.com
Fri Sep 1 18:58:28 EDT 2006


On 9/1/06, zope-dev at rosenthaltechnologies.com
<zope-dev at rosenthaltechnologies.com> wrote:
>
> I'm getting a ZODB.POSException.ConflictError in the following code in a
> Custom Zope Product, and I'm hoping someone can enlighten me on how to
> fix it.
>
> # nd is a folder with a sub-folder "Categories
> # "NDCategory" is a custom Zope product I wrote that does not have
> anything called "bogus" defined.
> categories = nd.Categories.objectValues('NDCategory')
> for cat in categories:
>         cat.bogus = []

Feels like you might be miss interpreting what a ConflictError is.

With some hand waving... ConflictErrors are _not_ a mechanism for
prohibiting attribute assignment because that attribute already
exists. Instead ConflictErrors are a mechanism to prohibit inadvertent
concurrent updates of the same attribute. (Or in older ZODB's, even
concurrent reading of an attribute that is being written too.)

Check the traceback for your ConflictError to get some details about
just what is in conflict. Also might be worth a look in the access
logs to see what else might be happening on the server at about the
same time.

Cheers
Michael


More information about the Zope-Dev mailing list