I am not happy that settings.ATOMIC_REQUESTS=True isolates only the view, but not the middlewares
in one transaction.
For applications like reversion (app which records the changes of a model) it is very important,
that the middleware runs inside the same transaction. If storing the changes
runs in a second transaction, inconsistencies will happen: Model got updated,
but storing the changes in the second transaction might fail.
We are in the process of updating our apps to Django 1.8.
At the moment our preferred solution:
- set settings.ATOMIC_REQUESTS=False
- Run an own middleware which starts and ends the transaction.
Nearly two years ago this kind of Middleware suggested in this list:
https://groups.google.com/forum/#!msg/django-users/njeVp4zT5HA/9g0wsFYZKAwJRelated issue for app reversion:
https://github.com/etianen/django-reversion/issues/268What do you think?