This blog is a knowledge base...where I clip cool tricks and urls

NHibernate SessionScope in ASP.NET

Getting started with NHibernate and Log4Net

Going on with session


As in ADO.NET we use database connection class to create queries or data adapter,
in NHibernate we use session object which is responsible for maintaining connection to database,
loading data into domain objects, detecting changes to domain object and syncing domain state with database.
NHibernate requires at least one session to work. As NHibernate caches domain object instances to
ensure that single row is loaded only once from database multi-user work with one session object is questionable.
This issue differ usage of NHibernate in WinForms and ASP.NET application.
The general idea is to have only one session per request and this can be achieved
either by using singleton pattern on using HttpModule. We will use the last one.
To do this we need to create a custom class, make it inherit IHttpModule interface

<httpModules>
    <add

type
="Dummy.DAL.NHibernateHttpModule"
name="NHibernateHttpModule"/>

  </httpModules>
 blog it

4 comments:

Anonymous said...

nksuksa uniform okstate uploads carroll geologic absolutely verified sharmacs become reenrollment
lolikneri havaqatsu

Anonymous said...

Well your article helped me altogether much in my college assignment. Hats incorrect to you enter, choice look audacious in behalf of more interdependent articles without delay as its anecdote of my choice question to read.

Anonymous said...

Sorry for my bad english. Thank you so much for your good post. Your post helped me in my college assignment, If you can provide me more details please email me.

Anonymous said...

top [url=http://www.001casino.com/]001[/url] coincide the latest [url=http://www.casinolasvegass.com/]casino games[/url] free no store perk at the best [url=http://www.baywatchcasino.com/]www.baywatchcasino.com
[/url].