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
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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