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

Still very experimental and it's not bullet proof for all situations
상속: AbstractScope
파일 보기 프로젝트 열기: nats/castle-1.0.3-mono 1 사용 예제들

공개 메소드들

메소드 설명
DifferentDatabaseScope ( IDbConnection connection ) : System

Initializes a new instance of the DifferentDatabaseScope class.

DifferentDatabaseScope ( IDbConnection connection, FlushAction flushAction ) : System

Initializes a new instance of the DifferentDatabaseScope class.

FailSession ( ISession session ) : void

This is called when a session 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 Castle.ActiveRecord.Framework.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

OpenSession ( ISessionFactory sessionFactory, IInterceptor interceptor ) : ISession

If the WantsToCreateTheSession returned true then this method is invoked to allow the scope to create a properly configured session

RegisterSession ( object key, ISession session ) : void

This method is invoked when no session was available at and the Castle.ActiveRecord.Framework.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

보호된 메소드들

메소드 설명
PerformDisposal ( ICollection sessions ) : void

Performs the disposal.

비공개 메소드들

메소드 설명
OnTransactionCompleted ( object sender, EventArgs e ) : void

메소드 상세

DifferentDatabaseScope() 공개 메소드

Initializes a new instance of the DifferentDatabaseScope class.
public DifferentDatabaseScope ( IDbConnection connection ) : System
connection IDbConnection The connection.
리턴 System

DifferentDatabaseScope() 공개 메소드

Initializes a new instance of the DifferentDatabaseScope class.
public DifferentDatabaseScope ( IDbConnection connection, FlushAction flushAction ) : System
connection IDbConnection The connection.
flushAction FlushAction The flush action.
리턴 System

FailSession() 공개 메소드

This is called when a session has a failure
public FailSession ( ISession session ) : void
session ISession the session
리턴 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 Castle.ActiveRecord.Framework.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() 공개 메소드

If the WantsToCreateTheSession returned true then this method is invoked to allow the scope to create a properly configured session
public OpenSession ( ISessionFactory sessionFactory, IInterceptor interceptor ) : ISession
sessionFactory ISessionFactory From where to open the session
interceptor IInterceptor the NHibernate interceptor
리턴 ISession

PerformDisposal() 보호된 메소드

Performs the disposal.
protected PerformDisposal ( ICollection sessions ) : void
sessions ICollection The sessions.
리턴 void

RegisterSession() 공개 메소드

This method is invoked when no session was available at and the Castle.ActiveRecord.Framework.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