本文整理匯總了C#中System.Transactions.Enlistment.Done方法的典型用法代碼示例。如果您正苦於以下問題:C# Enlistment.Done方法的具體用法?C# Enlistment.Done怎麽用?C# Enlistment.Done使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Transactions.Enlistment
的用法示例。
在下文中一共展示了Enlistment.Done方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: StringBuilder
/// <summary>
/// Make the transacted changes permanent.
/// </summary>
void IEnlistmentNotification.Commit(Enlistment enlistment)
{
_value = new StringBuilder(_temporaryValue.ToString());
_temporaryValue = null;
_enlistedTransaction = null;
enlistment.Done();
}
示例2: Commit
/// <summary>
/// Performs necessary commit actions, clearing the current <see cref="TransactionContext"/>
/// </summary>
public void Commit(Enlistment enlistment)
{
BeforeCommit();
DoCommit();
TransactionContext.Clear();
enlistment.Done();
}
示例3: Commit
public void Commit(Enlistment enlistment)
{
try
{
assertNotDisposed();
logger.DebugFormat("Committing enlistment with id: {0}", Id);
queueStorage.Global(actions =>
{
actions.RemoveReversalsMoveCompletedMessagesAndFinishSubQueueMove(Id);
actions.MarkAsReadyToSend(Id);
actions.DeleteRecoveryInformation(Id);
actions.Commit();
});
enlistment.Done();
logger.DebugFormat("Commited enlistment with id: {0}", Id);
}
catch (Exception e)
{
logger.Warn("Failed to commit enlistment " + Id, e);
throw;
}
finally
{
onCompelete();
}
}
示例4: InDoubt
public void InDoubt(Enlistment enlistment)
{
enlistment.Done();
this.notification.InDoubt();
Marshal.ReleaseComObject(this.notification);
this.notification = null;
}
示例5: Rollback
public void Rollback(Enlistment enlistment)
{
enlistment.Done();
this.notification.Aborted(0, false, 0, 0);
Marshal.ReleaseComObject(this.notification);
this.notification = null;
}
示例6: Commit
public void Commit(Enlistment enlistment)
{
log.Debug("Commit {0}, Messages: {1}", TransactionId, Messages.Count);
if (_oncommit != null) _oncommit(this);
enlistment.Done();
TransactionOpen = false;
}
示例7: Commit
public void Commit(Enlistment enlistment)
{
enlistment.Done();
this.notification.Committed(false, 0, 0);
Marshal.ReleaseComObject(this.notification);
this.notification = null;
}
示例8: Commit
public void Commit(Enlistment enlistment)
{
if (_ThrowIt)
Assert.Fail("commit is never called if prepare failed");
enlistment.Done();
}
示例9: InDoubt
public void InDoubt(Enlistment enlistment)
{
log.Warn("transaction in doubt {0}, messages {1}", TransactionId, this.Messages.Count);
if (_onrollback != null) _onrollback(this);
enlistment.Done();
TransactionOpen = false;
}
示例10: ApplicationException
void IEnlistmentNotification.Commit(Enlistment enlistment)
{
if (_ThrowIt && ++_ErrorCount < 2)
throw new ApplicationException("simulating resource failure");
enlistment.Done();
}
示例11: StringBuilder
void IEnlistmentNotification.Commit(Enlistment enlistment)
{
this.m_Value = new StringBuilder(this.m_TemporaryValue.ToString());
this.m_TemporaryValue = null;
this.enlistedTransaction = null;
enlistment.Done();
}
示例12: Rollback
public void Rollback(Enlistment enlistment)
{
foreach (var x in _rollbackCommands)
{
x();
}
enlistment.Done();
}
示例13: Commit
/// <summary>
/// Responds to the Commit notification.
/// </summary>
/// <param name="enlistment">An Enlistment that facilitates communication between the enlisted transaction participant and the transaction manager during the final phase of the transaction.</param>
public override void Commit(Enlistment enlistment)
{
if (enlistment != null)
{
// Indicate that the transaction participant has completed its work.
enlistment.Done();
}
}
示例14: InDoubt
public void InDoubt(Enlistment enlistment)
{
lock (_sharedLock)
{
if (InDoubtAction != null) InDoubtAction();
}
enlistment.Done();
}
示例15: Commit
public void Commit(Enlistment enlistment)
{
lock (_sharedLock)
{
if (CommitAction != null) CommitAction();
}
enlistment.Done();
}