[ZODB-Dev] How does automatic retrying work?

Claudiu Saftoiu csaftoiu at gmail.com
Thu Mar 29 18:28:12 UTC 2012


Hello all,

I have an HTTP request which has roughly two parts to it. One part
requires a lot of processing with a small chance of a DatabaseConflict,
while the other part requires little processing with a high chance of
a DatabaseConflict. I'd like to do something like this:

def my_view(request):
    transaction.begin()
    slow_no_conflict()
    transaction.commit()

    for avar in something:
        transaction.begin()
        fast_yes_conflict(avar)
        transaction.commit()

My question is: how will automatic retrying work? Most of my views are
simply:

def regular_view(request):
    do_stuff()

and, if something conflicts, the whole thing is just retried. In `my_view`,
what will happen if the `slow_no_conflict()` function has a conflict?
What will happen if the `fast_yes_conflict(avar)` function has a conflict?
What if its in the first iteration of the loop, or the last? I'm not quite
sure
how to properly think about these things yet.

Thanks,
- Claudiu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/zodb-dev/attachments/20120329/99549dfc/attachment.html>


More information about the ZODB-Dev mailing list