Rate this Message:
| Show Only this Message
Hello retry shall be made on a transaction basis.
I would say, that while for the regular_view retry may be handled by a
middleware or such (the publisher in Zope2 ?), you may want to manage it
in my_view around your transaction.
in my_view you do transaction commit, so you won't undo the
slow_no_conflict part if you fail in the second part (if it was not your
intent you shall use subtransactions).
So you may do something like :
from ZODB.POSException import ConflictError
do_retry = True
do_retry = False
except Exception, e:
do_retry = isinstance(e, ConflictError)
Hope this helps !