Hi Guga - in the team I work with we currently use the "open session in view" pattern with a "data access object" pattern for retrieving the domain objects.
We have the article from http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx as a starting point for our architecture. The effects of this architecture and the way we use it: 1) It is a very simple way to work with NHibernate. No managing of the session or transaction inside the code, we simply access our DAO class and load the objects. 2) All changes to persistent objects are persistsed by the HTTP handler responsible for the NH session. 3) We rely on the cascading persistence of NHibernate so we rarely have to call "Save" on the DAO's. Normally objects are put in some collection and persisted by the cascading setting. 4) We always reload objects from the database when we need to update them. We don't use session or viewstate for the domain objects. Concurrent updates must be detected manually. 5) On the downside: Since we just load objects from the DAOs as we go along, we currently have many hits on the database for each request. This is NOT good so we are investigating workarounds. Cheers, Thomas On 1 Jun., 18:17, Guga Oliveira <[email protected]> wrote: > Hello all, > > We have learned a lot with you this week. > > I am curious about how the most of you work with the objects in a > complex web page that do more than one request to the server. > > How do you preffer to work, persisting objects in every request and > storing the ids in the viewstate or session, or work with the objects > in the asp.net session and only in the final request do the > persistence (commit or flush). > > Thanks a lot. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. 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 -~----------~----~----~----~------~----~------~--~---
