Hello,
I have some doubt abut the good way to manage transaction in an
ASP.NET MVC application. I tried this :
1. Create the SessionFactory in he global.asax event Application_Start. In the controller create a session, begin a transaction and commit rollback, like this I can manage to view to return. But I have a lot of duplicate code.
2. I trid to create the session in the Application_BeginRequest event and commit in Application_EndRequest but like this I can't return a specific view and didn't find the way to know if a NHException occur during the transaction
May be the solution ... a mix of 1 and 2, create the session Application_BeginRequest and in the controller do the commit/rollback and return the view I want.
What do you think,
Thanks,