You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw this comment today. I must have missed the notification.
In that example, @transaction.non_atomic_requests ensures that with transaction.atomic() maps to a database transaction and not just a savepoint. So the example is correct in this regard.
However, the last line # If the transaction fails will never be reached. Only an exception can cause the transaction to fail and there's no code to handle such an exception.
Since you are using "with transaction.atomic()", the code wrapped by transaction.atomic() will only commit changes to database on success, whether you have the non_atomic_requests decorator or not. I believe that's what the docs state @ https://docs.djangoproject.com/en/1.6/topics/db/transactions/#django.db.transaction.atomic
The text was updated successfully, but these errors were encountered: