The reason I ask is that I am trying to run MVC side-by-side with WebForms.
For WebForms we use an HttpModule to open and close an NHibernate Session once per request – opening the session during HttpApplication.BeginRequest and HttpApplication.EndRequest. For MVC, the recommended method is to use an ActionFilterAttribute but to keep things simple I have decided to stick with the HttpModule.
However, I am using an ActionFilter to open and close Transactions.
I am getting some strange intermittent problems though and I’m curious whether the issue could be that the HttpApplication.EndRequest method is firing before the ActionFilter’s OnResultExecuted method.
Here’s the order of execution:
The
HttpApplication.EndRequestcan never fire beforeActionFilterAttribute.OnResultExecuted.