internal override Enlistment EnlistDurable(
InternalTransaction tx,
Guid resourceManagerIdentifier,
ISinglePhaseNotification enlistmentNotification,
EnlistmentOptions enlistmentOptions,
Transaction atomicTransaction)
{
tx.ThrowIfPromoterTypeIsNotMSDTC();
if (tx._durableEnlistment != null || (enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != 0)
{
// These circumstances cause promotion
tx._promoteState.EnterState(tx);
return tx.State.EnlistDurable(tx, resourceManagerIdentifier, enlistmentNotification, enlistmentOptions, atomicTransaction);
}
// Create a durable enlistment
Enlistment en = new Enlistment(resourceManagerIdentifier, tx, enlistmentNotification, enlistmentNotification, atomicTransaction);
tx._durableEnlistment = en.InternalEnlistment;
DurableEnlistmentState.DurableEnlistmentActive.EnterState(tx._durableEnlistment);
TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
if (etwLog.IsEnabled())
{
etwLog.TransactionstateEnlist(tx._durableEnlistment.EnlistmentTraceId, EnlistmentType.Durable, EnlistmentOptions.None);
}
return en;
}