Running middleware within ATOMIC_REQUESTS transaction

23 views
Skip to first unread message

Marc Aymerich

unread,
Mar 10, 2015, 4:14:01 PM3/10/15
to django-users
Hi,
I have a middleware that performs some operations at the end of each request.

What I have found is that middlewares do not run inside the ATOMIC_REQUESTS transaction. But I want the ATOMIC_REQUESTS transaction to rollback if an exception is being raised on my middleware.

Any idea on how to solve this?

Thanks!
--
Marc

Marc Aymerich

unread,
Mar 10, 2015, 4:16:27 PM3/10/15
to django-users
Well, I supose I can grab the TransactionMiddleware from the previous release and use that instead of ATOMIC_REQUESTS :)

 
--
Marc

Marc Aymerich

unread,
Mar 10, 2015, 4:39:27 PM3/10/15
to django-users
Not that easy, it seems that now all transactions are aborted by the middleware :( I'll keep looking....


 
-- 
Marc

Marc Aymerich

unread,
Mar 10, 2015, 4:50:19 PM3/10/15
to django-users
Stupid mistake, I was loading the wrong module xDD,

it works like a charm, sorry for all this noise ;)
 
--
Marc
Reply all
Reply to author
Forward
0 new messages