Django 1.6 proposes @transaction.atomic
as part of the rehaul in the transaction management from 1.5.
I have a function which is called by a Django manag
Yes. You should use atomic
in the places where you previously used commit_on_success
.
Since the new transaction system is designed to be more robust and consistent, though, it's possible that you could see different behavior. For example, if you catch database errors and try to continue on you will see a TransactionManagementError
, whereas the previous behavior was undefined and probably case-dependent.
But, if you're doing things properly, everything should continue to work the same way.