[ZODB-Dev] avoiding conflicts.
Steve Alexander
steve@cat-box.net
Tue, 11 Jun 2002 09:14:32 +0100
Terry Kerr wrote:
>
> The problem I have is that this method can take up to 10 seconds to
> complete, mainly due to the HTTP communication with the external
> systems, and during high load periods, this method may be called by
> several different users every second, thus, write conflicts emerge as
> the method updates the attributes on the global parent objects. Zope's
> way of attempting to resolve the conflict is to re-run the method. This
> works fine, and the conlfict is evenutally resolved even if after
> several goes. The problem however is that because the method is run
> several times, the information is posted to the external systems as many
> times which in my case is very very bad!
I'd run a separate long-running process to do your HTTP posting. The
Zope application communicates with this separate process via a queue, or
perhaps a queue-like object that knows how to collapse a number of
pending updates into a single one.
You could implement the communication using files on the filesystem. If
you do it maildir-style then your queue stays intact between restarts.
--
Steve Alexander