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

2006-09-03 Thread Dieter Maurer
Michael Dunstan wrote at 2006-9-2 10:58 +1200:
> ...
>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.)

A minor correction: not concurrent updates to the same attribute
but of the same persistent object.



-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


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

2006-09-01 Thread Michael Dunstan

On 9/1/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> 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
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


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

2006-09-01 Thread zope-dev

> how many categories are there and how often does this code get executed?

It's only one user and within one request where this is happening.  I'm
using ZEO.  There must be something I fundamentally don't understand
about how I assign an attribute to an object in the ZODB.  If you have
any insight nere, I'd appreciate it.

Best,
Brian

On Fri, 01 Sep 2006 09:40:24 +0100, "Chris Withers"
<[EMAIL PROTECTED]> said:
> [EMAIL PROTECTED] wrote:
> > I'm getting a ZODB.POSException.ConflictError in the following code in a
> > Custom Zope Product,
> 
> Google for "ConflictError Zope" and read, a lot. These are to be 
> expected due to Zope's concurrency model, but if end users are seeing 
> them then your application needs restructuring.
> 
> > # 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 = []
> 
> how many categories are there and how often does this code get executed?
> 
> cheers,
> 
> Chris
> 
> -- 
> Simplistix - Content Management, Zope & Python Consulting
> - http://www.simplistix.co.uk
> 

Brian Rosenthal
General Partner, RoboCommerce, LLC
[EMAIL PROTECTED]
http://www.robocommerce.com
800-644-7626

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


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

2006-09-01 Thread Chris Withers

[EMAIL PROTECTED] wrote:

I'm getting a ZODB.POSException.ConflictError in the following code in a
Custom Zope Product,


Google for "ConflictError Zope" and read, a lot. These are to be 
expected due to Zope's concurrency model, but if end users are seeing 
them then your application needs restructuring.



# 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 = []


how many categories are there and how often does this code get executed?

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


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

2006-09-01 Thread zope-dev

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 = []

Can anyone explain this to me?

Thank you in advance,
Brian Rosenthal

Brian Rosenthal
General Partner, RoboCommerce, LLC
[EMAIL PROTECTED]
http://www.robocommerce.com
800-644-7626

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )