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 3. I tried the Oren's code http://ayende.com/blog/4809/refactoring-toward-frictionless-odorless-code-what-about-transactions the sessionController is always null 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, -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/qkBeObV7a24J. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
