本文整理汇总了C#中System.Transactions.SinglePhaseEnlistment.Done方法的典型用法代码示例。如果您正苦于以下问题:C# SinglePhaseEnlistment.Done方法的具体用法?C# SinglePhaseEnlistment.Done怎么用?C# SinglePhaseEnlistment.Done使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Transactions.SinglePhaseEnlistment
的用法示例。
在下文中一共展示了SinglePhaseEnlistment.Done方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Rollback
public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
{
singlePhaseEnlistment.Done();
}
示例2: Dispose
///<summary>
/// Attempt to rollback the internal transaction.
///</summary>
void IPromotableSinglePhaseNotification.Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
{
try
{
// attempt to rollback the transaction
this.dbTransaction.Rollback();
singlePhaseEnlistment.Done();
}
finally
{
// clean-up our resources
Dispose();
}
}
示例3: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
try
{
Commit();
singlePhaseEnlistment.Done();
}
catch (Exception)
{
//on a callback thread, can't throw
}
}
示例4: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
try
{
PerformActualCommit();
singlePhaseEnlistment.Done();
}
catch (Exception e)
{
logger.Warn("Failed to commit enlistment " + Id, e);
throw;
}
finally
{
onCompelete();
}
}
示例5: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment)
{
#if DEBUG
System.Diagnostics.Trace.WriteLine("NuoDbTransaction::SinglePhaseCommit()");
#endif
Commit();
singlePhaseEnlistment.Done();
}
示例6: SinglePhaseCommit
public void SinglePhaseCommit(SinglePhaseEnlistment enlistment)
{
lock (this.syncObject)
{
try
{
Tracer.Debug("Single Phase Commit notification received for TX id: " + this.transactionId);
if (this.transactionId != null)
{
BeforeEnd();
// Now notify the broker that a new XA'ish transaction has completed.
TransactionInfo info = new TransactionInfo();
info.ConnectionId = this.connection.ConnectionId;
info.TransactionId = this.transactionId;
info.Type = (int) TransactionType.CommitOnePhase;
this.connection.CheckConnected();
this.connection.SyncRequest(info);
Tracer.Debug("Transaction Single Phase Commit Done TX id: " + this.transactionId);
// if server responds that nothing needs to be done, then reply done.
enlistment.Done();
AfterCommit();
}
}
catch (Exception ex)
{
Tracer.DebugFormat("Transaction[{0}] Single Phase Commit failed with error: {1}",
this.transactionId, ex.Message);
AfterRollback();
enlistment.Done();
try
{
this.connection.OnException(ex);
}
catch (Exception error)
{
Tracer.Error(error.ToString());
}
}
finally
{
this.currentEnlistment = null;
this.transactionId = null;
this.netTxState = TxState.None;
this.dtcControlEvent.Set();
}
}
}