本文整理汇总了C#中System.Transactions.Transaction.EnlistVolatile方法的典型用法代码示例。如果您正苦于以下问题:C# Transaction.EnlistVolatile方法的具体用法?C# Transaction.EnlistVolatile怎么用?C# Transaction.EnlistVolatile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Transactions.Transaction
的用法示例。
在下文中一共展示了Transaction.EnlistVolatile方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SQLiteEnlistment
internal SQLiteEnlistment(SQLiteConnection cnn, Transaction scope)
{
_transaction = cnn.BeginTransaction();
_scope = scope;
_scope.EnlistVolatile(this, System.Transactions.EnlistmentOptions.None);
}
示例2: DeveelDbEnlistment
public DeveelDbEnlistment(DeveelDbConnection connection, Transaction scope)
{
transaction = connection.BeginTransaction();
Scope = scope;
Scope.EnlistVolatile(this, EnlistmentOptions.None);
}
示例3: FbEnlistmentNotification
public FbEnlistmentNotification(FbConnectionInternal connection, Transaction systemTransaction)
{
_connection = connection;
_transaction = connection.BeginTransaction(systemTransaction.IsolationLevel);
_systemTransaction = systemTransaction;
_systemTransaction.EnlistVolatile(this, System.Transactions.EnlistmentOptions.None);
}
示例4: SQLiteEnlistment
internal SQLiteEnlistment(
SQLiteConnection cnn,
Transaction scope,
System.Data.IsolationLevel defaultIsolationLevel,
bool throwOnUnavailable,
bool throwOnUnsupported
)
{
_transaction = cnn.BeginTransaction(GetSystemDataIsolationLevel(
cnn, scope, defaultIsolationLevel, throwOnUnavailable,
throwOnUnsupported));
_scope = scope;
_scope.EnlistVolatile(this, System.Transactions.EnlistmentOptions.None);
}
示例5: SetInteriorTransaction
public void SetInteriorTransaction(Transaction interiorTransaction, bool needsCommit)
{
Fx.Assert(!this.context.IsHostTransaction, "SetInteriorTransaction called for a host transaction.");
if (this.waitForTransaction != null)
{
throw Fx.Exception.AsError(new InvalidOperationException(SRCore.ExecuteMustBeNested));
}
bool success = false;
try
{
this.waitForTransaction = new AsyncWaitHandle(EventResetMode.ManualReset);
interiorTransaction.EnlistVolatile(this, EnlistmentOptions.None);
success = true;
}
finally
{
if (!success)
{
if (this.waitForTransaction != null)
{
this.waitForTransaction.Set();
}
}
else if (needsCommit)
{
this.transactionToCommit = (CommittableTransaction)interiorTransaction;
}
}
}
示例6: RegisterForTransactionNotification
void RegisterForTransactionNotification(Transaction transaction)
{
if (Transaction.Current != null)
{
ReceiveContextEnlistmentNotification notification = new ReceiveContextEnlistmentNotification(this);
transaction.EnlistVolatile(notification, EnlistmentOptions.None);
Interlocked.Increment(ref this.ambientTransactionCount);
}
}
示例7: TxEnlistment
public TxEnlistment(Transaction tx)
{
tx.EnlistVolatile(this, EnlistmentOptions.None);
}
示例8: CreateVolatileEnlistment
TransactionException CreateVolatileEnlistment(Transaction transactionToEnlist)
{
TransactionException result = null;
PersistenceContextEnlistment enlistment = null;
int key = transactionToEnlist.GetHashCode();
lock (PersistenceContext.Enlistments)
{
try
{
if (!PersistenceContext.Enlistments.TryGetValue(key, out enlistment))
{
enlistment = new PersistenceContextEnlistment(this.PersistenceContext, transactionToEnlist);
transactionToEnlist.EnlistVolatile(enlistment, EnlistmentOptions.None);
// We don't save of the Enlistment object returned from EnlistVolatile. We don't need
// it here. When our PersistenceContextEnlistment object gets notified on Prepare,
// Commit, Rollback, or InDoubt, it is provided with the Enlistment object.
PersistenceContext.Enlistments.Add(key, enlistment);
}
else
{
enlistment.AddToEnlistment(this.PersistenceContext);
}
}
catch (TransactionException txException)
{
result = txException;
// We own the lock but failed to create enlistment. Manually wake up the next waiter.
// We only handle TransactionException, in case of other exception that failed to create enlistment,
// It will fallback to Timeout. This is safe to avoid multiple waiters owning same lock.
this.PersistenceContext.ScheduleNextTransactionWaiter();
}
}
return result;
}
示例9: SetInteriorTransaction
public void SetInteriorTransaction(Transaction interiorTransaction, bool needsCommit)
{
if (this.waitForTransaction != null)
{
throw Fx.Exception.AsError(new InvalidOperationException(SRCore.ExecuteMustBeNested));
}
bool flag = false;
try
{
this.waitForTransaction = new AsyncWaitHandle(EventResetMode.ManualReset);
interiorTransaction.EnlistVolatile((ISinglePhaseNotification) this, EnlistmentOptions.None);
flag = true;
}
finally
{
if (!flag)
{
if (this.waitForTransaction != null)
{
this.waitForTransaction.Set();
}
}
else if (needsCommit)
{
this.transactionToCommit = (CommittableTransaction) interiorTransaction;
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:InstancePersistenceContext.cs
示例10: EventResourceManager
public EventResourceManager(EventEmitter eventEmitter, Transaction transaction)
{
this.eventEmitter = eventEmitter;
transaction.EnlistVolatile(this, EnlistmentOptions.None);
changes = new List<RaisedEvent>();
}
示例11: VoterBallot
internal VoterBallot(ITransactionVoterNotifyAsync2 notification, Transaction transaction)
{
this.transaction = transaction;
this.notification = notification;
this.enlistment = transaction.EnlistVolatile(this, EnlistmentOptions.None);
}