Ejemplo n.º 1
0
 public void EndTransaction(EntityTransaction transaction)
 {
     lock (_entityTransactionsLocker)
     {
         this._entityTransactions.Remove(transaction);
         if (this._entityTransactions.Count == 0)
         {
             this._entityTransactionsSignal.Set();
         }
     }
 }
Ejemplo n.º 2
0
        public EntityTransaction BeginTransaction <T>(T entity)
            where T : class
        {
            _attachTransactionsSignal.WaitOne();
            var transaction = new EntityTransaction(this, new[] { entity });

            lock (_entityTransactionsLocker)
            {
                _entityTransactions.Add(transaction, DateTime.Now);
                _entityTransactionsSignal.Reset();
            }

            return(transaction);
        }