C# Class NSoft.NFramework.Data.NHibernateEx.UnitOfWork

Utility class for Unit Of Work
显示文件 Open project: debop/NFramework Class Usage Examples

Public Methods

Method Description
DisposeUnitOfWork ( IUnitOfWorkImplementor unitOfWork ) : void

called internally to clear the current Unit Of Work and move to the previous one.

DisposeUnitOfWorkFactory ( ) : void

여러 Database에 작업 시 기존 UnitOfWorkFactory를 초기화 해줍니다.

EndLongConversation ( ) : void

Long conversation 을 종료시킵니다.

GetCurrentSessionFor ( Type typeOfEntity ) : ISession

지정된 Entity 형식이 매핑된 현재 Session을 반환한다.

GetCurrentSessionFor ( string name ) : ISession

지정된 Session factory name으로 부터 현재 세션 객체를 가져온다.

RegisterGlobalUnitOfWork ( IUnitOfWork global ) : IDisposable

NOT Thread-safe!!! using 구문을 이용하여 작업을 처리할 때 편리하도록 제공한다.

SetCurrentSession ( Type typeOfEntity, ISession session ) : void

지정된 Entity 형식을 해당 Session에 매핑시킨다.

SetCurrentSessionName ( string name ) : IDisposable

지정된 session factory name을 사용하는 session을 current session으로 설정한다.

Start ( ) : IUnitOfWork

새로운 Unit Of Work을 시작합니다.

Start ( IDbConnection connection ) : IUnitOfWork

새로운 Unit Of Work을 시작합니다.

Start ( IDbConnection connection, UnitOfWorkNestingOptions nestingOptions ) : IUnitOfWork

새로운 Unit Of Work을 시작합니다.

Start ( UnitOfWorkNestingOptions nestingOptions ) : IUnitOfWork

새로운 Unit Of Work을 시작합니다.

StartLongConversation ( ) : void

ASP.NET Session을 이용하여 다중 Page Request에 대해 Transaction이 가능하도록 합니다. 단 실제 Database Transaction과는 달리 Session을 닫지 않는 다는 뜻입니다.

StartPrivateConversation ( ) : System.Guid

Signals the start of an application/user transaction that spans multiple page requests, but is not loaded without explicitly specifying the conversation key.

Used in conjunction with UnitOfWorkHttpApplication, will ensure that the current UoW (see Current) is kept intact across multiple page requests. Review the LongConversationManager for details.

Note: This method does not start a physical database transaction.

Stop ( ) : void

현재 실행중인 UnitOfWork를 끝냅니다.

Stop ( bool needFlushing ) : void

현재 실행중인 UnitOfWork를 끝냅니다.

Method Details

DisposeUnitOfWork() public static method

called internally to clear the current Unit Of Work and move to the previous one.
public static DisposeUnitOfWork ( IUnitOfWorkImplementor unitOfWork ) : void
unitOfWork IUnitOfWorkImplementor
return void

DisposeUnitOfWorkFactory() public static method

여러 Database에 작업 시 기존 UnitOfWorkFactory를 초기화 해줍니다.
public static DisposeUnitOfWorkFactory ( ) : void
return void

EndLongConversation() public static method

Long conversation 을 종료시킵니다.
public static EndLongConversation ( ) : void
return void

GetCurrentSessionFor() public static method

지정된 Entity 형식이 매핑된 현재 Session을 반환한다.
public static GetCurrentSessionFor ( Type typeOfEntity ) : ISession
typeOfEntity System.Type
return ISession

GetCurrentSessionFor() public static method

지정된 Session factory name으로 부터 현재 세션 객체를 가져온다.
public static GetCurrentSessionFor ( string name ) : ISession
name string Factory name
return ISession

RegisterGlobalUnitOfWork() public static method

NOT Thread-safe!!! using 구문을 이용하여 작업을 처리할 때 편리하도록 제공한다.
public static RegisterGlobalUnitOfWork ( IUnitOfWork global ) : IDisposable
global IUnitOfWork
return IDisposable

SetCurrentSession() public static method

지정된 Entity 형식을 해당 Session에 매핑시킨다.
public static SetCurrentSession ( Type typeOfEntity, ISession session ) : void
typeOfEntity System.Type
session ISession
return void

SetCurrentSessionName() public static method

지정된 session factory name을 사용하는 session을 current session으로 설정한다.
public static SetCurrentSessionName ( string name ) : IDisposable
name string
return IDisposable

Start() public static method

새로운 Unit Of Work을 시작합니다.
public static Start ( ) : IUnitOfWork
return IUnitOfWork

Start() public static method

새로운 Unit Of Work을 시작합니다.
public static Start ( IDbConnection connection ) : IUnitOfWork
connection IDbConnection
return IUnitOfWork

Start() public static method

새로운 Unit Of Work을 시작합니다.
public static Start ( IDbConnection connection, UnitOfWorkNestingOptions nestingOptions ) : IUnitOfWork
connection IDbConnection
nestingOptions UnitOfWorkNestingOptions
return IUnitOfWork

Start() public static method

새로운 Unit Of Work을 시작합니다.
public static Start ( UnitOfWorkNestingOptions nestingOptions ) : IUnitOfWork
nestingOptions UnitOfWorkNestingOptions
return IUnitOfWork

StartLongConversation() public static method

ASP.NET Session을 이용하여 다중 Page Request에 대해 Transaction이 가능하도록 합니다. 단 실제 Database Transaction과는 달리 Session을 닫지 않는 다는 뜻입니다.
public static StartLongConversation ( ) : void
return void

StartPrivateConversation() public static method

Signals the start of an application/user transaction that spans multiple page requests, but is not loaded without explicitly specifying the conversation key.
Used in conjunction with UnitOfWorkHttpApplication, will ensure that the current UoW (see Current) is kept intact across multiple page requests. Review the LongConversationManager for details.

Note: This method does not start a physical database transaction.

public static StartPrivateConversation ( ) : System.Guid
return System.Guid

Stop() public static method

현재 실행중인 UnitOfWork를 끝냅니다.
public static Stop ( ) : void
return void

Stop() public static method

현재 실행중인 UnitOfWork를 끝냅니다.
public static Stop ( bool needFlushing ) : void
needFlushing bool Session에 보관된 내용을 Flushing을 할 것인지 여부
return void