C# Class Castle.ActiveRecord.Framework.SessionFactoryHolder

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

Méthodes publiques

Méthode 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

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

Method Details

FailSession() public méthode

Called if an action on the session fails
public FailSession ( ISession session ) : void
session ISession
Résultat void

GetAllConfigurations() public méthode

Pendent
public GetAllConfigurations ( ) : NHibernate.Cfg.Configuration[]
Résultat NHibernate.Cfg.Configuration[]

GetConfiguration() public méthode

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

GetRootType() public méthode

Gets the type of the root.
public GetRootType ( Type type ) : Type
type System.Type The type.
Résultat System.Type

GetSessionFactory() public méthode

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

Register() public méthode

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

RegisterSessionFactory() public méthode

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
Résultat void

ReleaseSession() public méthode

Releases the specified session
public ReleaseSession ( ISession session ) : void
session ISession
Résultat void