Chapter 3. Sessions and Transactions

In this chapter, we will cover the following topics:

  • Setting up session-per-web request
  • Setting up session-per-presenter
  • Creating a session ASP.NET MVC action filter
  • Creating a transaction ASP.NET MVC action filter
  • Save entities to the database
  • Using session.Merge
  • Using session.Refresh
  • Handle concurrency using session.Lock
  • Using dictionaries as entities
  • Using NHibernate with transaction scope

Introduction

NHibernate leaves session and transaction management up to the application. There are a number of different ways to manage sessions and transactions, and they depend greatly on the specific application architecture. In addition to a few interesting session methods, the recipes in this chapter show how to handle sessions and transactions for these different types of applications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.125.100