本文整理汇总了C#中System.Transactions.InternalTransaction类的典型用法代码示例。如果您正苦于以下问题:C# InternalTransaction类的具体用法?C# InternalTransaction怎么用?C# InternalTransaction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InternalTransaction类属于System.Transactions命名空间,在下文中一共展示了InternalTransaction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Rollback
internal override void Rollback(InternalTransaction tx, Exception e)
{
if (tx.innerException == null)
{
tx.innerException = e;
}
TransactionState._TransactionStateDelegatedAborting.EnterState(tx);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TransactionStateDelegated.cs
示例17: Timeout
internal override void Timeout(InternalTransaction tx)
{
if (DiagnosticTrace.Warning)
{
TransactionTimeoutTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), tx.TransactionTraceId);
}
TimeoutException e = new TimeoutException(System.Transactions.SR.GetString("TraceTransactionTimeout"));
this.Rollback(tx, e);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:EnlistableStates.cs
示例18: CompleteAbortingClone
internal override void CompleteAbortingClone(InternalTransaction tx)
{
// A blocking clone simulates a phase 1 volatile
//
// Unlike a blocking clone however the aborting clones need to be accounted
// for specifically. So when one is complete remove it from the list.
tx._phase1Volatiles._dependentClones--;
Debug.Assert(tx._phase1Volatiles._dependentClones >= 0);
}
开发者ID:dotnet,项目名称:corefx,代码行数:9,代码来源:TransactionState.cs
示例19: Rollback
internal override void Rollback(InternalTransaction tx, Exception e)
{
if (tx.innerException == null)
{
tx.innerException = e;
}
tx.PromotedTransaction.Rollback();
TransactionState._TransactionStatePromotedAborted.EnterState(tx);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:TransactionStateDelegatedSubordinate.cs
示例20: Rollback
internal override void Rollback(InternalTransaction tx, Exception e)
{
if (tx.innerException == null)
{
tx.innerException = e;
}
((ISimpleTransactionSuperior) tx.promoter).Rollback();
TransactionState._TransactionStateAborted.EnterState(tx);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:TransactionStateSubordinateActive.cs
注:本文中的System.Transactions.InternalTransaction类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论