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
_______________________________________________
For more information about ZODB, see http://zodb.org/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to