Ejemplo n.º 1
0
        internal static void FireDistributedTransactionStarted(Transaction transaction)
        {
            TransactionStartedEventHandler localStartedEventHandler = null;

            lock (ClassSyncObject)
            {
                localStartedEventHandler = s_distributedTransactionStartedDelegate;
            }

            if (null != localStartedEventHandler)
            {
                TransactionEventArgs args = new TransactionEventArgs();
                args._transaction = transaction.InternalClone();
                localStartedEventHandler(args._transaction, args);
            }
        }
        internal static void FireDistributedTransactionStarted(Transaction transaction)
        {
            TransactionStartedEventHandler distributedTransactionStartedDelegate = null;

            lock (ClassSyncObject)
            {
                distributedTransactionStartedDelegate = TransactionManager.distributedTransactionStartedDelegate;
            }
            if (distributedTransactionStartedDelegate != null)
            {
                TransactionEventArgs e = new TransactionEventArgs {
                    transaction = transaction.InternalClone()
                };
                distributedTransactionStartedDelegate(e.transaction, e);
            }
        }
Ejemplo n.º 3
0
 internal static void ProcessExistingTransactions(TransactionStartedEventHandler eventHandler)
 {
     lock ( PromotedTransactionTable )
     {
         foreach (DictionaryEntry entry in PromotedTransactionTable)
         {
             WeakReference weakRef = (WeakReference)entry.Value;
             Transaction   tx      = (Transaction)weakRef.Target;
             if (tx != null)
             {
                 TransactionEventArgs args = new TransactionEventArgs();
                 args.transaction = tx.InternalClone();
                 eventHandler(args.transaction, args);
             }
         }
     }
 }
 internal static void ProcessExistingTransactions(TransactionStartedEventHandler eventHandler)
 {
     lock (PromotedTransactionTable)
     {
         foreach (DictionaryEntry entry in PromotedTransactionTable)
         {
             WeakReference reference = (WeakReference)entry.Value;
             Transaction   target    = (Transaction)reference.Target;
             if (target != null)
             {
                 TransactionEventArgs e = new TransactionEventArgs {
                     transaction = target.InternalClone()
                 };
                 eventHandler(e.transaction, e);
             }
         }
     }
 }
Ejemplo n.º 5
0
        internal static void ProcessExistingTransactions(TransactionStartedEventHandler eventHandler)
        {
            lock (PromotedTransactionTable)
            {
                // Manual use of IDictionaryEnumerator instead of foreach to avoid DictionaryEntry box allocations.
                IDictionaryEnumerator e = PromotedTransactionTable.GetEnumerator();
                while (e.MoveNext())
                {
                    WeakReference weakRef = (WeakReference)e.Value !;

                    if (weakRef.Target is Transaction tx)
                    {
                        TransactionEventArgs args = new TransactionEventArgs();
                        args._transaction = tx.InternalClone();
                        eventHandler(args._transaction, args);
                    }
                }
            }
        }
Ejemplo n.º 6
0
 internal static void ProcessExistingTransactions(TransactionStartedEventHandler eventHandler)
 {
     lock (PromotedTransactionTable)
     {
         // Manual use of IDictionaryEnumerator instead of foreach to avoid DictionaryEntry box allocations.
         IDictionaryEnumerator e = PromotedTransactionTable.GetEnumerator();
         while (e.MoveNext())
         {
             WeakReference weakRef = (WeakReference)e.Value;
             Transaction tx = (Transaction)weakRef.Target;
             if (tx != null)
             {
                 TransactionEventArgs args = new TransactionEventArgs();
                 args._transaction = tx.InternalClone();
                 eventHandler(args._transaction, args);
             }
         }
     }
 }
Ejemplo n.º 7
0
 internal static void ProcessExistingTransactions( TransactionStartedEventHandler eventHandler )
 {
     lock ( PromotedTransactionTable )
     {
         foreach ( DictionaryEntry entry in PromotedTransactionTable )
         {
             WeakReference weakRef = (WeakReference)entry.Value;
             Transaction tx = (Transaction)weakRef.Target;
             if ( tx != null )
             {
                 TransactionEventArgs args = new TransactionEventArgs();
                 args.transaction = tx.InternalClone();
                 eventHandler( args.transaction, args );
             }
         }
     }
 }
 internal static void ProcessExistingTransactions(TransactionStartedEventHandler eventHandler)
 {
     lock (PromotedTransactionTable)
     {
         foreach (DictionaryEntry entry in PromotedTransactionTable)
         {
             WeakReference reference = (WeakReference) entry.Value;
             Transaction target = (Transaction) reference.Target;
             if (target != null)
             {
                 TransactionEventArgs e = new TransactionEventArgs {
                     transaction = target.InternalClone()
                 };
                 eventHandler(e.transaction, e);
             }
         }
     }
 }
 internal static void FireDistributedTransactionStarted(Transaction transaction)
 {
     TransactionStartedEventHandler distributedTransactionStartedDelegate = null;
     lock (ClassSyncObject)
     {
         distributedTransactionStartedDelegate = TransactionManager.distributedTransactionStartedDelegate;
     }
     if (distributedTransactionStartedDelegate != null)
     {
         TransactionEventArgs e = new TransactionEventArgs {
             transaction = transaction.InternalClone()
         };
         distributedTransactionStartedDelegate(e.transaction, e);
     }
 }