Berthold Stöger wrote at 2006-6-29 20:35 +0200:
>On Thursday 29 June 2006 18:56, Dieter Maurer wrote:
>> Good application design would make the conflict probability so low
>> that it is very unlikely that a "ConflictError" propagates to
>> the user.
>
>For more complicated applications  this is only possible with locking.

For many, even complex applications, it can be done without locking.

>Does 
>Zope provide locking primitives?

The ZODB does not support locking.

You can use Python's locking in Zope -- but it won't help you
with "ConflictError"s.

>Or, ideally, something like asynchronous message passing? I would love to be 
>able to start a transaction and, if it finishes in less than x seconds, tell 
>the user the result or, if it hasn't finshed by then, that the transaction is 
>being processed, please come back later.

This can be done -- when you program it:

  You can start a separate thread (or process) that performs the transaction
  and indicates completion in some adequate way.
  In your request processing, you wait a given time for completion
  and if this time out return some message.

  Note that it is not easy to correctly manage separate threads.
  In particular, you cannot pass persistent objects between threads:
  the separate thread must open its own ZODB connection
  and must be careful to perform transaction management and
  release all resources when it finishes.



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

Reply via email to