I got big problem cuz i’m not so experienced with nhibernate and i need to choose best session solution to project so here is example of session usage:
-Session opens and make query to fill gridview
-Person double click on filled gridview and is redirected to another page with edit option
-He edit Object that he had from gridview
-He save object and go back to gridview
-Gridview is displaing saved object
-he edit another ….
So what is best session for me and when to open / close new sessions.
I would create a session per request (here’s one resource, google would find many more).
The scenario you’ve described is pretty commonplace; i’d use a
QueryOverto populate your gridview, andLoadto fetch the selected item. Simple.