C# 클래스 Castle.ActiveRecord.Scopes.DifferentDatabaseScope

Still very experimental and it's not bullet proof for all situations
상속: SessionScope
파일 보기 프로젝트 열기: shosca/ActiveRecord

공개 메소드들

메소드 설명
DifferentDatabaseScope ( IDbConnection connection, FlushAction flushAction = FlushAction.Auto, ISessionScope parent = null, ISessionFactoryHolder holder = null, IThreadScopeInfo scopeinfo = null ) : System

Initializes a new instance of the DifferentDatabaseScope class.

Dispose ( ) : void
FailScope ( ) : void

This is called when a scope has a failure

GetSession ( object key ) : ISession

This method should return the session instance associated with the key.

IsKeyKnown ( object key ) : bool

This method is invoked when the ISessionFactoryHolder instance needs a session instance. Instead of creating one it interrogates the active scope for one. The scope implementation must check if it has a session registered for the given key. RegisterSession

RegisterSession ( object key, ISession session ) : void

This method is invoked when no session was available at and the ISessionFactoryHolder just created one. So it registers the session created within this scope using a key. The scope implementation shouldn't make any assumption on what the key actually is as we reserve the right to change it IsKeyKnown

보호된 메소드들

메소드 설명
CreateSession ( ISessionFactory sessionFactory, IInterceptor interceptor ) : ISession

This method is invoked to allow the scope to create a properly configured session

OpenSession ( Type type ) : ISession

메소드 상세

CreateSession() 보호된 메소드

This method is invoked to allow the scope to create a properly configured session
protected CreateSession ( ISessionFactory sessionFactory, IInterceptor interceptor ) : ISession
sessionFactory ISessionFactory From where to open the session
interceptor IInterceptor the NHibernate interceptor
리턴 ISession

DifferentDatabaseScope() 공개 메소드

Initializes a new instance of the DifferentDatabaseScope class.
public DifferentDatabaseScope ( IDbConnection connection, FlushAction flushAction = FlushAction.Auto, ISessionScope parent = null, ISessionFactoryHolder holder = null, IThreadScopeInfo scopeinfo = null ) : System
connection IDbConnection
flushAction FlushAction
parent ISessionScope
holder ISessionFactoryHolder
scopeinfo IThreadScopeInfo
리턴 System

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

FailScope() 공개 메소드

This is called when a scope has a failure
public FailScope ( ) : void
리턴 void

GetSession() 공개 메소드

This method should return the session instance associated with the key.
public GetSession ( object key ) : ISession
key object an object instance
리턴 ISession

IsKeyKnown() 공개 메소드

This method is invoked when the ISessionFactoryHolder instance needs a session instance. Instead of creating one it interrogates the active scope for one. The scope implementation must check if it has a session registered for the given key. RegisterSession
public IsKeyKnown ( object key ) : bool
key object an object instance
리턴 bool

OpenSession() 보호된 메소드

protected OpenSession ( Type type ) : ISession
type System.Type
리턴 ISession

RegisterSession() 공개 메소드

This method is invoked when no session was available at and the ISessionFactoryHolder just created one. So it registers the session created within this scope using a key. The scope implementation shouldn't make any assumption on what the key actually is as we reserve the right to change it IsKeyKnown
public RegisterSession ( object key, ISession session ) : void
key object an object instance
session ISession An instance of ISession
리턴 void