C# 클래스 uShip.NHibernate.UnitOfWork.UnitOfWorkEvents

Register global callbacks that are notified when exceptions occur during UnitOfWork calls to InnerExecute(), Transaction.Commit(), and Transaction.Rollback(). These handlers will be called for the remainder of the application lifetime, and cannot be un-registered.
파일 보기 프로젝트 열기: uShip/NHibernateUnitOfWork

공개 메소드들

메소드 설명
AddGlobalExecuteOrCommitExceptionHandler ( OnException handler ) : void

Register a global callback that will be notified when exceptions occur during UnitOfWork calls to InnerExecute() or ITransaction.Commit(). This handler will be called for the remainder of the application lifetime, and cannot be un-registered.

AddGlobalRollbackExceptionHandler ( OnException handler ) : void

Register a global callback that will be notified when exceptions occur during UnitOfWork calls to ITransaction.Rollback(). This handler will be called for the remainder of the application lifetime, and cannot be un-registered.

The exception will still bubble up from the original call, so this is NOT a substitute for normal exception handling.

비공개 메소드들

메소드 설명
OnExecuteOrCommitException ( ISessionFactory sessionFactory, Exception exc ) : void

This method should only be invoked by UnitOfWork(of T).Execute(). It is called when an exception occurs either during the InnerExecute() method or during an automatic Transaction.Commit().

OnRollbackException ( ISessionFactory sessionFactory, Exception exc ) : void

This method should only be invoked by UnitOfWork(of T).Execute(). It is called when an exception occurs during an automatic call Transaction.Rollback().

RemoveAllHandlers ( ) : void

FOR UNIT TESTING ONLY

메소드 상세

AddGlobalExecuteOrCommitExceptionHandler() 공개 정적인 메소드

Register a global callback that will be notified when exceptions occur during UnitOfWork calls to InnerExecute() or ITransaction.Commit(). This handler will be called for the remainder of the application lifetime, and cannot be un-registered.
public static AddGlobalExecuteOrCommitExceptionHandler ( OnException handler ) : void
handler OnException
리턴 void

AddGlobalRollbackExceptionHandler() 공개 정적인 메소드

Register a global callback that will be notified when exceptions occur during UnitOfWork calls to ITransaction.Rollback(). This handler will be called for the remainder of the application lifetime, and cannot be un-registered.

The exception will still bubble up from the original call, so this is NOT a substitute for normal exception handling.

public static AddGlobalRollbackExceptionHandler ( OnException handler ) : void
handler OnException
리턴 void