當前位置: 首頁>>代碼示例>>C#>>正文


C# Transactions.InternalTransaction類代碼示例

本文整理匯總了C#中System.Transactions.InternalTransaction的典型用法代碼示例。如果您正苦於以下問題:C# InternalTransaction類的具體用法?C# InternalTransaction怎麽用?C# InternalTransaction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InternalTransaction類屬於System.Transactions命名空間,在下文中一共展示了InternalTransaction類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CompleteAbortingClone

 internal override void CompleteAbortingClone(InternalTransaction tx)
 {
     if (tx.phase1Volatiles.VolatileDemux != null)
     {
         tx.phase1Volatiles.dependentClones--;
     }
     else
     {
         tx.abortingDependentCloneCount--;
         if (tx.abortingDependentCloneCount == 0)
         {
             OletxDependentTransaction abortingDependentClone = tx.abortingDependentClone;
             tx.abortingDependentClone = null;
             Monitor.Exit(tx);
             try
             {
                 try
                 {
                     abortingDependentClone.Complete();
                 }
                 finally
                 {
                     abortingDependentClone.Dispose();
                 }
             }
             finally
             {
                 Monitor.Enter(tx);
             }
         }
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:32,代碼來源:TransactionStatePromotedBase.cs

示例2: BeginCommit

 internal override void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback asyncCallback, object asyncState)
 {
     tx.asyncCommit = asyncCommit;
     tx.asyncCallback = asyncCallback;
     tx.asyncState = asyncState;
     TransactionState._TransactionStateDelegatedCommitting.EnterState(tx);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:TransactionStateDelegated.cs

示例3: PSPEPromote

 internal OletxTransaction PSPEPromote(InternalTransaction tx)
 {
     TransactionState state = tx.State;
     base.CommonEnterState(tx);
     OletxTransaction oletxTransactionFromTransmitterPropigationToken = null;
     try
     {
         byte[] propagationToken = tx.promoter.Promote();
         if (propagationToken == null)
         {
             throw TransactionException.CreateInvalidOperationException(System.Transactions.SR.GetString("TraceSourceLtm"), System.Transactions.SR.GetString("PromotedReturnedInvalidValue"), null);
         }
         try
         {
             oletxTransactionFromTransmitterPropigationToken = TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(propagationToken);
         }
         catch (ArgumentException exception)
         {
             throw TransactionException.CreateInvalidOperationException(System.Transactions.SR.GetString("TraceSourceLtm"), System.Transactions.SR.GetString("PromotedReturnedInvalidValue"), exception);
         }
         if (TransactionManager.FindPromotedTransaction(oletxTransactionFromTransmitterPropigationToken.Identifier) != null)
         {
             oletxTransactionFromTransmitterPropigationToken.Dispose();
             throw TransactionException.CreateInvalidOperationException(System.Transactions.SR.GetString("TraceSourceLtm"), System.Transactions.SR.GetString("PromotedTransactionExists"), null);
         }
     }
     finally
     {
         state.CommonEnterState(tx);
     }
     return oletxTransactionFromTransmitterPropigationToken;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:32,代碼來源:TransactionStatePSPEOperation.cs

示例4: Add

 internal bool Add(InternalTransaction tx)
 {
     int index = Interlocked.Increment(ref this.index);
     if (index < this.size)
     {
         tx.tableBucket = this;
         tx.bucketIndex = index;
         Thread.MemoryBarrier();
         this.transactions[index] = tx;
         if (!this.timedOut)
         {
             goto Label_0097;
         }
         lock (tx)
         {
             tx.State.Timeout(tx);
             goto Label_0097;
         }
     }
     Bucket bucket = new Bucket(this.owningSet) {
         nextBucketWeak = new WeakReference(this)
     };
     if (Interlocked.CompareExchange<Bucket>(ref this.owningSet.headBucket, bucket, this) == this)
     {
         this.previous = bucket;
     }
     return false;
 Label_0097:
     return true;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:30,代碼來源:Bucket.cs

示例5: Add

 internal int Add(InternalTransaction txNew)
 {
     Thread.BeginCriticalRegion();
     int num = 0;
     try
     {
         num = this.rwLock.AcquireReaderLock();
         try
         {
             if ((txNew.AbsoluteTimeout != 0x7fffffffffffffffL) && !this.timerEnabled)
             {
                 if (!this.timer.Change(this.timerInterval, this.timerInterval))
                 {
                     throw TransactionException.CreateInvalidOperationException(System.Transactions.SR.GetString("TraceSourceLtm"), System.Transactions.SR.GetString("UnexpectedTimerFailure"), null);
                 }
                 this.lastTimerTime = DateTime.UtcNow.Ticks;
                 this.timerEnabled = true;
             }
             txNew.CreationTime = this.CurrentTime;
             this.AddIter(txNew);
         }
         finally
         {
             this.rwLock.ReleaseReaderLock();
         }
     }
     finally
     {
         Thread.EndCriticalRegion();
     }
     return num;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:32,代碼來源:TransactionTable.cs

示例6: EnterState

 internal override void EnterState(InternalTransaction tx)
 {
     base.CommonEnterState(tx);
     if (tx.committableTransaction != null)
     {
         tx.committableTransaction.complete = true;
     }
     if (tx.phase1Volatiles.dependentClones != 0)
     {
         tx.State.ChangeStateTransactionAborted(tx, null);
     }
     else
     {
         int volatileEnlistmentCount = tx.phase1Volatiles.volatileEnlistmentCount;
         if (tx.phase1Volatiles.preparedVolatileEnlistments < volatileEnlistmentCount)
         {
             for (int i = 0; i < volatileEnlistmentCount; i++)
             {
                 tx.phase1Volatiles.volatileEnlistments[i].twoPhaseState.ChangeStatePreparing(tx.phase1Volatiles.volatileEnlistments[i]);
                 if (!tx.State.ContinuePhase1Prepares())
                 {
                     return;
                 }
             }
         }
         else
         {
             this.Phase1VolatilePrepareDone(tx);
         }
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:31,代碼來源:TransactionStatePromotedPhase1.cs

示例7: EnterState

 internal override void EnterState(InternalTransaction tx)
 {
     base.CommonEnterState(tx);
     tx.committableTransaction.complete = true;
     if (tx.phase1Volatiles.dependentClones != 0)
     {
         TransactionState._TransactionStateAborted.EnterState(tx);
     }
     else if (((tx.phase1Volatiles.volatileEnlistmentCount == 1) && (tx.durableEnlistment == null)) && (tx.phase1Volatiles.volatileEnlistments[0].SinglePhaseNotification != null))
     {
         TransactionState._TransactionStateVolatileSPC.EnterState(tx);
     }
     else if (tx.phase1Volatiles.volatileEnlistmentCount > 0)
     {
         for (int i = 0; i < tx.phase1Volatiles.volatileEnlistmentCount; i++)
         {
             tx.phase1Volatiles.volatileEnlistments[i].twoPhaseState.ChangeStatePreparing(tx.phase1Volatiles.volatileEnlistments[i]);
             if (!tx.State.ContinuePhase1Prepares())
             {
                 return;
             }
         }
     }
     else
     {
         TransactionState._TransactionStateSPC.EnterState(tx);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:28,代碼來源:TransactionStateVolatilePhase1.cs

示例8: InternalEnlistment

 internal InternalEnlistment(System.Transactions.Enlistment enlistment, IEnlistmentNotification twoPhaseNotifications, InternalTransaction transaction, System.Transactions.Transaction atomicTransaction)
 {
     this.enlistment = enlistment;
     this.twoPhaseNotifications = twoPhaseNotifications;
     this.transaction = transaction;
     this.atomicTransaction = atomicTransaction;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:InternalEnlistment.cs

示例9: EnterState

 internal override void EnterState(InternalTransaction tx)
 {
     base.EnterState(tx);
     base.CommonEnterState(tx);
     for (int i = 0; i < tx.phase0Volatiles.volatileEnlistmentCount; i++)
     {
         tx.phase0Volatiles.volatileEnlistments[i].twoPhaseState.InternalAborted(tx.phase0Volatiles.volatileEnlistments[i]);
     }
     for (int j = 0; j < tx.phase1Volatiles.volatileEnlistmentCount; j++)
     {
         tx.phase1Volatiles.volatileEnlistments[j].twoPhaseState.InternalAborted(tx.phase1Volatiles.volatileEnlistments[j]);
     }
     if (tx.durableEnlistment != null)
     {
         tx.durableEnlistment.State.InternalAborted(tx.durableEnlistment);
     }
     TransactionManager.TransactionTable.Remove(tx);
     if (DiagnosticTrace.Warning)
     {
         TransactionAbortedTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), tx.TransactionTraceId);
     }
     tx.FireCompletion();
     if (tx.asyncCommit)
     {
         tx.SignalAsyncCompletion();
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:27,代碼來源:TransactionStateAborted.cs

示例10: EnterState

 internal override void EnterState(InternalTransaction tx)
 {
     if (tx.needPulse)
     {
         Monitor.Pulse(tx);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:TransactionStateEnded.cs

示例11: Add

        internal bool Add(InternalTransaction tx)
        {
            int currentIndex = Interlocked.Increment(ref _index);
            if (currentIndex < _size)
            {
                tx._tableBucket = this;
                tx._bucketIndex = currentIndex;
                Interlocked.MemoryBarrier(); // This data must be written before the transaction
                                             // could be timed out.
                _transactions[currentIndex] = tx;

                if (_timedOut)
                {
                    lock (tx)
                    {
                        tx.State.Timeout(tx);
                    }
                }
            }
            else
            {
                Bucket newBucket = new Bucket(_owningSet);
                newBucket.nextBucketWeak = new WeakReference(this);

                Bucket oldBucket = Interlocked.CompareExchange(ref _owningSet.headBucket, newBucket, this);
                if (oldBucket == this)
                {
                    // ladies and gentlemen we have a winner.
                    _previous = newBucket;
                }

                return false;
            }
            return true;
        }
開發者ID:dotnet,項目名稱:corefx,代碼行數:35,代碼來源:TransactionTable.cs

示例12: PromotedTransactionOutcome

 protected override void PromotedTransactionOutcome(InternalTransaction tx)
 {
     if ((tx.innerException == null) && (tx.PromotedTransaction != null))
     {
         tx.innerException = tx.PromotedTransaction.InnerException;
     }
     throw TransactionInDoubtException.Create(System.Transactions.SR.GetString("TraceSourceBase"), tx.innerException);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:TransactionStatePromotedIndoubt.cs

示例13: ChangeStatePromotedAborted

 internal virtual void ChangeStatePromotedAborted(InternalTransaction tx)
 {
     if (DiagnosticTrace.Error)
     {
         InvalidOperationExceptionTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), "");
     }
     throw new InvalidOperationException();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:TransactionState.cs

示例14: CompleteBlockingClone

 internal override void CompleteBlockingClone(InternalTransaction tx)
 {
     tx.phase0Volatiles.dependentClones--;
     if (tx.phase0Volatiles.preparedVolatileEnlistments == (tx.phase0VolatileWaveCount + tx.phase0Volatiles.dependentClones))
     {
         tx.State.Phase0VolatilePrepareDone(tx);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:EnlistableStates.cs

示例15: ChangeStateTransactionAborted

 internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exception e)
 {
     if (tx.innerException == null)
     {
         tx.innerException = e;
     }
     TransactionState._TransactionStatePromotedP1Aborting.EnterState(tx);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:TransactionStatePromotedPhase1.cs


注:本文中的System.Transactions.InternalTransaction類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。