title: When do the HttpApplication.BeginRequest and EndRequest events fire relative to ActionFilter.OnResultExecuted in the MVC pipeline?
body: <p>The reason I ask is that I am trying to run MVC side-by-side with WebForms.</p>
  
  <p>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.</p>
  
  <p>However, I <em>am</em> using an ActionFilter to open and close Transactions.</p>
  
  <p>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.</p>