Ejemplo n.º 1
0
        public IUnitOfWork CreateUnitOfWork()
        {
            if (connection.State != ConnectionState.Open)
            {
                connection.Open();
            }

            IDbTransaction transaction = connection.BeginTransaction();
            var            unitOfWork  = new SurveyUnitOfWork(transaction, RemoveTransaction, RemoveTransaction);

            readWriteLock.EnterWriteLock();
            workList.AddLast(unitOfWork);
            readWriteLock.ExitWriteLock();

            return(unitOfWork);
        }
Ejemplo n.º 2
0
 private void RemoveTransaction(SurveyUnitOfWork unitOfWork)
 {
     readWriteLock.EnterWriteLock();
     workList.Remove(unitOfWork);
     readWriteLock.ExitWriteLock();
 }