FoodCandy!

Session Class Reference

From Andrew Mayorov, http://wiki.nhibernate.org/display/NH/Using+NHibernate+with+ASP.Net. More...

List of all members.


Static Public Member Functions

static void BeginRequest ()
 Initializes internal state for handling new request. Call this method at the beginning of the ASP.NET request.
static void EndRequest ()
 Finalizes the request. If current session exists the method flushes it and closes. Call this method at the end of ASP.NET request.
static IDisposable OpenConnection (IDbConnection connection)
static void CloseAndFlush ()
 Flushes and closes current session.
static void Close ()
 Closes current session.
static void Flush ()
 Flushes current session.
static Transaction BeginTransaction ()
 Begins new COM+ transaction.

Properties

static NHibernate.Cfg.Configuration Configuration
 Returns an instance of NHibernate::Cfg::Configuration object containing the configuration for current application.
static DomainModel Model
static ISessionFactory Factory
 Returns an object implementing NHibernate::ISessionFactory interface, used to create new sessions.
static ISession Current
 Returns a current session object.

Classes

class  HttpSessionSource
 Stores a session in the HttpContext::Items collection.
class  ISessionStorage
class  ThreadSessionSource
 Stores a session in the thread-static class member.

Detailed Description

From Andrew Mayorov, http://wiki.nhibernate.org/display/NH/Using+NHibernate+with+ASP.Net.


Member Function Documentation

static Transaction BeginTransaction  )  [static]
 

Begins new COM+ transaction.

Returns:
Transaction object allowing to set transaction vote.

If current session exists, it will be closed first.
Returned transaction object implements IDisposable and must be disposed after use in order to finish the transaction.

            using( Transaction tx = Session.BeginTransaction() ) 
            {
                        ...
                }

static void Close  )  [static]
 

Closes current session.

N.B. Close do not flush the session.


Property Documentation

NHibernate.Cfg.Configuration Configuration [static, get, set]
 

Returns an instance of NHibernate::Cfg::Configuration object containing the configuration for current application.

The object is being created upon first request for it.

ISession Current [static, get]
 

Returns a current session object.

The session object will be created upon first request for it.

ISessionFactory Factory [static, get, set]
 

Returns an object implementing NHibernate::ISessionFactory interface, used to create new sessions.

The factory is created upon first request for it.


The documentation for this class was generated from the following file:
  • Session.cs
© FoodCandy, 2006-2007, All Rights Reserved | FoodCandy | Sun Oct 7 10:48:52 2007 | Doxygen 1.4.6-NO