C# 클래스 Habanero.BO.DataAccessorThreadSplitter

This Data accessor manages separate sub-data accessors per thread. This is needed because in some cases the ADO.NET provider is not thread-safe (eg SQL CE) so maintaining a separate database connection per thread is required. To use it make sure that each thread in your system has added its own dataaccessor using AddDataAccessorForThread
상속: IDataAccessor
파일 보기 프로젝트 열기: Chillisoft/habanero 1 사용 예제들

공개 메소드들

메소드 설명
AddDataAccessorForThread ( IDataAccessor dataAccessor ) : void

Adds a data accessor to the collection of data accessors. This data accessor will be used for this thread.

ClearDeadThreads ( ) : void

Clears data accessors for threads that have died. This method is called every 5 seconds, or can be called explicitly.

CreateTransactionCommitter ( ) : ITransactionCommitter

Creates a TransactionCommitter for you to use to persist BusinessObjects. A new TransactionCommitter is required each time an object or set of objects is persisted.

DataAccessorThreadSplitter ( IDataAccessor dataAccessor ) : System.Collections.Generic

Construct using an initial IDataAccessor, which will be the one used for this thread.

GetDataAccessorForThread ( Thread thread ) : IDataAccessor

Returns the data accessor for the given thread. You can use this to check if your current thread has a data accessor before trying to use it.

메소드 상세

AddDataAccessorForThread() 공개 메소드

Adds a data accessor to the collection of data accessors. This data accessor will be used for this thread.
public AddDataAccessorForThread ( IDataAccessor dataAccessor ) : void
dataAccessor IDataAccessor
리턴 void

ClearDeadThreads() 공개 메소드

Clears data accessors for threads that have died. This method is called every 5 seconds, or can be called explicitly.
public ClearDeadThreads ( ) : void
리턴 void

CreateTransactionCommitter() 공개 메소드

Creates a TransactionCommitter for you to use to persist BusinessObjects. A new TransactionCommitter is required each time an object or set of objects is persisted.
public CreateTransactionCommitter ( ) : ITransactionCommitter
리턴 ITransactionCommitter

DataAccessorThreadSplitter() 공개 메소드

Construct using an initial IDataAccessor, which will be the one used for this thread.
public DataAccessorThreadSplitter ( IDataAccessor dataAccessor ) : System.Collections.Generic
dataAccessor IDataAccessor
리턴 System.Collections.Generic

GetDataAccessorForThread() 공개 메소드

Returns the data accessor for the given thread. You can use this to check if your current thread has a data accessor before trying to use it.
If no data accessor for this thread is found this exception will be thrown.
public GetDataAccessorForThread ( Thread thread ) : IDataAccessor
thread System.Threading.Thread
리턴 IDataAccessor