Hello all,<div><br></div><div>I have an HTTP request which has roughly two parts to it. One part</div><div>requires a lot of processing with a small chance of a DatabaseConflict,</div><div>while the other part requires little processing with a high chance of</div>
<div>a DatabaseConflict. I&#39;d like to do something like this:</div><div><br></div><div>def my_view(request):</div><div>    transaction.begin()</div><div>    slow_no_conflict()</div><div>    transaction.commit()</div><div>
    </div><div>    for avar in something:</div><div>        transaction.begin()</div><div>        fast_yes_conflict(avar)</div><div>        transaction.commit()</div><div><br></div><div>My question is: how will automatic retrying work? Most of my views are simply:</div>
<div><br></div><div>def regular_view(request):</div><div>    do_stuff()</div><div><br></div><div>and, if something conflicts, the whole thing is just retried. In `my_view`, </div><div>what will happen if the `slow_no_conflict()` function has a conflict? </div>
<div>What will happen if the `fast_yes_conflict(avar)` function has a conflict?</div><div>What if its in the first iteration of the loop, or the last? I&#39;m not quite sure</div><div>how to properly think about these things yet.</div>
<div><br></div><div>Thanks,</div><div>- Claudiu</div>