Regarding the order of middleware, this question states:
SessionMiddleware
- Before
TransactionMiddleware
: we don't need transactions here
Why would I not want my session updates in my transaction? If the session is updated as a side effect of something which occurs in the view and the view fails, I cannot imagine a case where I would want the session to be nonetheless updated as if it had not failed. (Clearly if the session engine is not db-based, this problem would have to be approached some other way.)
Please provide a clear use case why I might want the SessionMiddleware
to run outside the TransactionMiddleware
.