public void Complete()
        {
            if (DiagnosticTrace.Verbose)
            {
                MethodEnteredTraceRecord.Trace(SR.GetString(SR.TraceSourceOletx),
                                               "DependentTransaction.Complete"
                                               );
            }

            Debug.Assert((0 == this.disposed), "OletxTransction object is disposed");

            int localCompleted = Interlocked.CompareExchange(ref this.completed, 1, 0);

            if (1 == localCompleted)
            {
                throw TransactionException.CreateTransactionCompletedException(SR.GetString(SR.TraceSourceOletx));
            }

            if (DiagnosticTrace.Information)
            {
                DependentCloneCompleteTraceRecord.Trace(SR.GetString(SR.TraceSourceOletx),
                                                        this.TransactionTraceId
                                                        );
            }

            this.volatileEnlistmentContainer.DependentCloneCompleted();

            if (DiagnosticTrace.Verbose)
            {
                MethodExitedTraceRecord.Trace(SR.GetString(SR.TraceSourceOletx),
                                              "DependentTransaction.Complete"
                                              );
            }
        }
 public void Complete()
 {
     if (DiagnosticTrace.Verbose)
     {
         MethodEnteredTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), "DependentTransaction.Complete");
     }
     lock (base.internalTransaction)
     {
         if (base.Disposed)
         {
             throw new ObjectDisposedException("Transaction");
         }
         if (base.complete)
         {
             throw TransactionException.CreateTransactionCompletedException(System.Transactions.SR.GetString("TraceSourceLtm"));
         }
         base.complete = true;
         if (this.blocking)
         {
             base.internalTransaction.State.CompleteBlockingClone(base.internalTransaction);
         }
         else
         {
             base.internalTransaction.State.CompleteAbortingClone(base.internalTransaction);
         }
     }
     if (DiagnosticTrace.Information)
     {
         DependentCloneCompleteTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), base.TransactionTraceId);
     }
     if (DiagnosticTrace.Verbose)
     {
         MethodExitedTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), "DependentTransaction.Complete");
     }
 }
Exemple #3
0
        public void Complete()
        {
            if (DiagnosticTrace.Verbose)
            {
                MethodEnteredTraceRecord.Trace(SR.TraceSourceLtm, "DependentTransaction.Complete");
            }

            lock (_internalTransaction)
            {
                if (Disposed)
                {
                    throw new ObjectDisposedException(nameof(DependentTransaction));
                }

                if (_complete)
                {
                    throw TransactionException.CreateTransactionCompletedException(SR.TraceSourceLtm, DistributedTxId);
                }

                _complete = true;

                if (_blocking)
                {
                    _internalTransaction.State.CompleteBlockingClone(_internalTransaction);
                }
                else
                {
                    _internalTransaction.State.CompleteAbortingClone(_internalTransaction);
                }
            }

            if (DiagnosticTrace.Information)
            {
                DependentCloneCompleteTraceRecord.Trace(SR.TraceSourceLtm, TransactionTraceId);
            }
            if (DiagnosticTrace.Verbose)
            {
                MethodExitedTraceRecord.Trace(SR.TraceSourceLtm, "DependentTransaction.Complete");
            }
        }
        public void Complete()
        {
            if (DiagnosticTrace.Verbose)
            {
                MethodEnteredTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceOletx"), "DependentTransaction.Complete");
            }
            int num = Interlocked.CompareExchange(ref this.completed, 1, 0);

            if (1 == num)
            {
                throw TransactionException.CreateTransactionCompletedException(System.Transactions.SR.GetString("TraceSourceOletx"));
            }
            if (DiagnosticTrace.Information)
            {
                DependentCloneCompleteTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceOletx"), base.TransactionTraceId);
            }
            this.volatileEnlistmentContainer.DependentCloneCompleted();
            if (DiagnosticTrace.Verbose)
            {
                MethodExitedTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceOletx"), "DependentTransaction.Complete");
            }
        }