示例#1
0
 private void CurrentTransactionCompleted(object sender, System.Transactions.TransactionEventArgs e)
 {
     if (e.Transaction.TransactionInformation.Status == System.Transactions.TransactionStatus.Committed)
     {
         if (TransactQueue[QueueName] != null)
         {
             foreach (var item in TransactQueue[QueueName])
             {
                 RealAdd(item);
             }
         }
     }
     TransactQueue.Clear();
     Transaction = null;
 }
示例#2
0
 protected void CreateQueue(string queueName)
 {
     if (!Queue.ContainsKey(queueName))
     {
         lock (Queue)
         {
             if (!Queue.ContainsKey(queueName))
             {
                 Queue.Add(queueName, new List <object>());
             }
         }
     }
     if (!TransactQueue.ContainsKey(queueName))
     {
         var aux = new object();
         lock (aux)
         {
             if (!TransactQueue.ContainsKey(queueName))
             {
                 TransactQueue.Add(queueName, new List <object>());
             }
         }
     }
 }