C# Class Castle.ActiveRecord.Framework.SessionFactoryHolder

Default implementation of ISessionFactoryHolder
This class is thread safe
Inheritance: System.MarshalByRefObject, ISessionFactoryHolder
Mostrar archivo Open project: nats/castle-1.0.3-mono

Public Methods

Method Description
FailSession ( ISession session ) : void

Called if an action on the session fails

GetAllConfigurations ( ) : NHibernate.Cfg.Configuration[]

Pendent

GetConfiguration ( Type type ) : NHibernate.Cfg.Configuration

Requests the Configuration associated to the type.

GetRootType ( Type type ) : Type

Gets the type of the root.

GetSessionFactory ( Type type ) : ISessionFactory

Optimized with reader/writer lock.

Register ( Type rootType, NHibernate.Cfg.Configuration cfg ) : void

Associates a Configuration object to a root type

RegisterSessionFactory ( ISessionFactory sessionFactory, Type baseType ) : void

This method allows direct registration of a session factory to a type, bypassing the normal preperation that AR usually does. The main usage is in testing, so you would be able to switch the session factory for each test. Note that this will override the current session factory for the baseType.

ReleaseSession ( ISession session ) : void

Releases the specified session

Private Methods

Method Description
CreateScopeSession ( Type type ) : ISession
CreateSession ( Type type ) : ISession
OpenSession ( ISessionFactory sessionFactory ) : ISession
OpenSessionWithScope ( ISessionScope scope, ISessionFactory sessionFactory ) : ISession

Method Details

FailSession() public method

Called if an action on the session fails
public FailSession ( ISession session ) : void
session ISession
return void

GetAllConfigurations() public method

Pendent
public GetAllConfigurations ( ) : NHibernate.Cfg.Configuration[]
return NHibernate.Cfg.Configuration[]

GetConfiguration() public method

Requests the Configuration associated to the type.
public GetConfiguration ( Type type ) : NHibernate.Cfg.Configuration
type System.Type
return NHibernate.Cfg.Configuration

GetRootType() public method

Gets the type of the root.
public GetRootType ( Type type ) : Type
type System.Type The type.
return System.Type

GetSessionFactory() public method

Optimized with reader/writer lock.
public GetSessionFactory ( Type type ) : ISessionFactory
type System.Type
return ISessionFactory

Register() public method

Associates a Configuration object to a root type
public Register ( Type rootType, NHibernate.Cfg.Configuration cfg ) : void
rootType System.Type
cfg NHibernate.Cfg.Configuration
return void

RegisterSessionFactory() public method

This method allows direct registration of a session factory to a type, bypassing the normal preperation that AR usually does. The main usage is in testing, so you would be able to switch the session factory for each test. Note that this will override the current session factory for the baseType.
public RegisterSessionFactory ( ISessionFactory sessionFactory, Type baseType ) : void
sessionFactory ISessionFactory
baseType System.Type
return void

ReleaseSession() public method

Releases the specified session
public ReleaseSession ( ISession session ) : void
session ISession
return void