I have a scenario similar to this: Asp.NET MVC 4 website using nHibernate session for request. A session is introduced using Ninject into the repository using the Get and Save methods.
There are many articles that talk about the session behind the request and say that this is a way to do something in a web application.
But I have problems with implementing this logic:
Read Data From Database Alter Entity information Save to Database Read another entity Alter entity Save ... but an EXCEPTION OCCURS
I want to show my opinion with a message to the user. But I am also updating the resulting webpage, so I also have to read some information from the database.
According to nHibernate documentation, session with exception should be dropped Documentation here
But I cannot find articles on how best to move on.
What is the best approach for this situation ?. Will I need to add a new session to my repository object?
Thanks.
source share