Because of its simplicity, the most common pattern used in web applications for managing NHibernate sessions is session-per-request. In this recipe, I'll show you how to set up the session-per-request pattern using NHibernate's contextual sessions feature.
log4net.dll, and our
Eg.Coremodel and mappings project from Chapter 1.
web.configfile, set up the NHibernate and log4net configuration sections. Refer to the Configuring NHibernate with App.config recipes in Chapter 2.
web.config, add the