本文整理汇总了C#中ISinglePhaseNotification类的典型用法代码示例。如果您正苦于以下问题:C# ISinglePhaseNotification类的具体用法?C# ISinglePhaseNotification怎么用?C# ISinglePhaseNotification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISinglePhaseNotification类属于命名空间,在下文中一共展示了ISinglePhaseNotification类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InternalEnlistment
internal InternalEnlistment(System.Transactions.Enlistment enlistment, InternalTransaction transaction, IEnlistmentNotification twoPhaseNotifications, ISinglePhaseNotification singlePhaseNotifications, System.Transactions.Transaction atomicTransaction)
{
this.enlistment = enlistment;
this.transaction = transaction;
this.twoPhaseNotifications = twoPhaseNotifications;
this.singlePhaseNotifications = singlePhaseNotifications;
this.atomicTransaction = atomicTransaction;
this.enlistmentId = transaction.enlistmentCount++;
this.traceIdentifier = EnlistmentTraceIdentifier.Empty;
}
示例2: Enlistment
internal Enlistment(InternalTransaction transaction, IEnlistmentNotification twoPhaseNotifications, ISinglePhaseNotification singlePhaseNotifications, Transaction atomicTransaction, EnlistmentOptions enlistmentOptions)
{
if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != EnlistmentOptions.None)
{
this.internalEnlistment = new System.Transactions.InternalEnlistment(this, transaction, twoPhaseNotifications, singlePhaseNotifications, atomicTransaction);
}
else
{
this.internalEnlistment = new Phase1VolatileEnlistment(this, transaction, twoPhaseNotifications, singlePhaseNotifications, atomicTransaction);
}
}
示例3: EnlistDurable
internal override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
{
if ((tx.durableEnlistment != null) || ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != EnlistmentOptions.None))
{
tx.promoteState.EnterState(tx);
return tx.State.EnlistDurable(tx, resourceManagerIdentifier, enlistmentNotification, enlistmentOptions, atomicTransaction);
}
Enlistment enlistment = new Enlistment(resourceManagerIdentifier, tx, enlistmentNotification, enlistmentNotification, atomicTransaction);
tx.durableEnlistment = enlistment.InternalEnlistment;
DurableEnlistmentState._DurableEnlistmentActive.EnterState(tx.durableEnlistment);
if (DiagnosticTrace.Information)
{
EnlistmentTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), tx.durableEnlistment.EnlistmentTraceId, EnlistmentType.Durable, EnlistmentOptions.None);
}
return enlistment;
}
示例4: Enlistment
internal Enlistment(
Guid resourceManagerIdentifier,
InternalTransaction transaction,
IEnlistmentNotification twoPhaseNotifications,
ISinglePhaseNotification singlePhaseNotifications,
Transaction atomicTransaction)
{
_internalEnlistment = new DurableInternalEnlistment(
this,
resourceManagerIdentifier,
transaction,
twoPhaseNotifications,
singlePhaseNotifications,
atomicTransaction
);
}
示例5: EnlistVolatile
internal override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
{
Enlistment enlistment = new Enlistment(tx, enlistmentNotification, enlistmentNotification, atomicTransaction, enlistmentOptions);
if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != EnlistmentOptions.None)
{
base.AddVolatileEnlistment(ref tx.phase0Volatiles, enlistment);
}
else
{
base.AddVolatileEnlistment(ref tx.phase1Volatiles, enlistment);
}
if (DiagnosticTrace.Information)
{
EnlistmentTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceLtm"), enlistment.InternalEnlistment.EnlistmentTraceId, EnlistmentType.Volatile, enlistmentOptions);
}
return enlistment;
}
示例6: EnlistDurable
// Forward request to the state machine to take the appropriate action.
//
public Enlistment EnlistDurable(
Guid resourceManagerIdentifier,
ISinglePhaseNotification singlePhaseNotification,
EnlistmentOptions enlistmentOptions)
{
if (DiagnosticTrace.Verbose)
{
MethodEnteredTraceRecord.Trace(SR.TraceSourceLtm, "Transaction.EnlistDurable( ISinglePhaseNotification )");
}
if (Disposed)
{
throw new ObjectDisposedException(nameof(Transaction));
}
if (resourceManagerIdentifier == Guid.Empty)
{
throw new ArgumentException(SR.BadResourceManagerId, nameof(resourceManagerIdentifier));
}
if (singlePhaseNotification == null)
{
throw new ArgumentNullException(nameof(singlePhaseNotification));
}
if (enlistmentOptions != EnlistmentOptions.None && enlistmentOptions != EnlistmentOptions.EnlistDuringPrepareRequired)
{
throw new ArgumentOutOfRangeException(nameof(enlistmentOptions));
}
if (_complete)
{
throw TransactionException.CreateTransactionCompletedException(SR.TraceSourceLtm, DistributedTxId);
}
lock (_internalTransaction)
{
Enlistment enlistment = _internalTransaction.State.EnlistDurable(_internalTransaction,
resourceManagerIdentifier, singlePhaseNotification, enlistmentOptions, this);
if (DiagnosticTrace.Verbose)
{
MethodExitedTraceRecord.Trace(SR.TraceSourceLtm, "Transaction.EnlistDurable( ISinglePhaseNotification )");
}
return enlistment;
}
}
示例7: PromoteAndEnlistDurable
public Enlistment PromoteAndEnlistDurable(Guid resourceManagerIdentifier,
IPromotableSinglePhaseNotification promotableNotification,
ISinglePhaseNotification enlistmentNotification,
EnlistmentOptions enlistmentOptions)
{
if (DiagnosticTrace.Verbose)
{
MethodEnteredTraceRecord.Trace(SR.GetString(SR.TraceSourceOletx),
"Transaction.PromoteAndEnlistDurable"
);
}
if (Disposed)
{
throw new ObjectDisposedException("Transaction");
}
if (resourceManagerIdentifier == Guid.Empty)
{
throw new ArgumentException(SR.GetString(SR.BadResourceManagerId), "resourceManagerIdentifier");
}
if (promotableNotification == null)
{
throw new ArgumentNullException("promotableNotification");
}
if (enlistmentNotification == null)
{
throw new ArgumentNullException("enlistmentNotification");
}
if (enlistmentOptions != EnlistmentOptions.None && enlistmentOptions != EnlistmentOptions.EnlistDuringPrepareRequired)
{
throw new ArgumentOutOfRangeException("enlistmentOptions");
}
if (this.complete)
{
throw TransactionException.CreateTransactionCompletedException(SR.GetString(SR.TraceSourceLtm));
}
lock (this.internalTransaction)
{
Enlistment enlistment = this.internalTransaction.State.PromoteAndEnlistDurable(this.internalTransaction,
resourceManagerIdentifier, promotableNotification, enlistmentNotification, enlistmentOptions, this);
if (DiagnosticTrace.Verbose)
{
MethodExitedTraceRecord.Trace(SR.GetString(SR.TraceSourceOletx),
"Transaction.PromoteAndEnlistDurable"
);
}
return enlistment;
}
}
示例8: EnlistDurable
public Enlistment EnlistDurable (Guid manager,
ISinglePhaseNotification notification,
EnlistmentOptions options)
{
if (durables.Count == 1)
throw new NotImplementedException ("Only LTM supported. Cannot have more than 1 durable resource per transaction.");
EnsureIncompleteCurrentScope ();
if (options != EnlistmentOptions.None)
throw new NotImplementedException ("Implement me");
durables.Add (notification);
/* FIXME: Enlistment ?? */
return new Enlistment ();
}
示例9: EnlistDurable
internal override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
{
throw new TransactionException(System.Transactions.SR.GetString("TooLate"));
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:TransactionStatePromotedPhase1.cs
示例10: EnlistVolatile
public Enlistment EnlistVolatile (
ISinglePhaseNotification notification,
EnlistmentOptions options)
{
/* FIXME: Anything extra reqd for this? */
return EnlistVolatileInternal (notification, options);
}
示例11: EnlistVolatile
internal override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
{
throw new TransactionException(System.Transactions.SR.GetString("TooLate"));
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:TransactionStatePromotedPhase1.cs
示例12: EnlistVolatile
internal virtual Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
{
throw TransactionException.CreateTransactionStateException(System.Transactions.SR.GetString("TraceSourceLtm"), tx.innerException);
}
示例13: EnlistVolatile
internal override Enlistment EnlistVolatile(
InternalTransaction tx,
ISinglePhaseNotification enlistmentNotification,
EnlistmentOptions enlistmentOptions,
Transaction atomicTransaction
)
{
tx._promoteState.EnterState(tx);
return tx.State.EnlistVolatile(tx, enlistmentNotification, enlistmentOptions, atomicTransaction);
}
示例14: DurableInternalEnlistment
internal DurableInternalEnlistment(
Enlistment enlistment,
Guid resourceManagerIdentifier,
InternalTransaction transaction,
IEnlistmentNotification twoPhaseNotifications,
ISinglePhaseNotification singlePhaseNotifications,
Transaction atomicTransaction
) :
base(enlistment, transaction, twoPhaseNotifications, singlePhaseNotifications, atomicTransaction)
{
this.resourceManagerIdentifier = resourceManagerIdentifier;
}
示例15: EnlistDurable
internal override Enlistment EnlistDurable(
InternalTransaction tx,
Guid resourceManagerIdentifier,
ISinglePhaseNotification enlistmentNotification,
EnlistmentOptions enlistmentOptions,
Transaction atomicTransaction
)
{
Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");
tx.ThrowIfPromoterTypeIsNotMSDTC();
// Don't hold locks while calling into the promoted tx
Monitor.Exit(tx);
try
{
Enlistment en = new Enlistment(
resourceManagerIdentifier,
tx,
enlistmentNotification,
enlistmentNotification,
atomicTransaction
);
EnlistmentState.EnlistmentStatePromoted.EnterState(en.InternalEnlistment);
en.InternalEnlistment.PromotedEnlistment =
tx.PromotedTransaction.EnlistDurable(
resourceManagerIdentifier,
(DurableInternalEnlistment)en.InternalEnlistment,
true,
enlistmentOptions
);
return en;
}
finally
{
Monitor.Enter(tx);
}
}