本文整理匯總了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();
}
}
}