[Zope-dev] Re: Zope container objects can't multitask; Z2 CONFLICT mis-reported
Jim Fulton
jim@digicool.com
Mon, 01 Nov 1999 08:54:22 -0500
gtk wrote:
>
> Zope container objects can't multitask. If you try and add more than one
> item to a folder at a time -- even if they have different ids -- a Z2
> CONFLICT error occurs.
Adding items to a folder in separate threads does cause a conflict, since you
are modifying the same object, the folder. The database detects this situation
and raises a conflict error. The application detects conflict errors and retries
the request up to three times. If the request doesn't succeed on the third try,
then an error is returned to the user. The error should be a conflict error.
Zope *is* successfully multi-tasking. The definition of successful
multi-tasking is that, *if* data are written, they are written correctly.
One thread doesn't overwrite partial results from another thread, causing data
inconsistencies. Refusal to write data, while not desireable, is acceptable.
If you have an application that has such a high write rate to a single object,
such as a folder, you should consider redesigning the application to
avoid this hot spot.
In the future, we plan to add protocols that will allow objects to
resolve conflicts at the application level. This would allow
some conflicting operations, such as folder adds to be non-conflicting
(assuming that the items added had different ids of course).
> To add insult to injury, the error message sent to
> the user seems to be almost random. I've seen both of these:
>
> Missing doc string at: http://BEETLEJUICE:8080/folder1
> The parameter, <em>id</em>, was omitted from the request.
This is a bug. I have submitted it to the Collector
(http://www.zope.org:8080/Collector/) on your behaf.
Jim
--
Jim Fulton mailto:jim@digicool.com Python Powered!
Technical Director (888) 344-4332 http://www.python.org
Digital Creations http://www.digicool.com http://www.zope.org
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.