Skip to content

Instantly share code, notes, and snippets.

@davybrion
Created September 10, 2012 19:30
Show Gist options
  • Save davybrion/3693225 to your computer and use it in GitHub Desktop.
Save davybrion/3693225 to your computer and use it in GitHub Desktop.
code snippets for "MSDTC Woes With NServiceBus And NHibernate" post
public class DummyEnlistmentNotification : IEnlistmentNotification
{
public static readonly Guid Id = new Guid("E2D35055-4187-4ff5-82A1-F1F161A008D0");
public void Prepare(PreparingEnlistment preparingEnlistment)
{
preparingEnlistment.Prepared();
}
public void Commit(Enlistment enlistment)
{
enlistment.Done();
}
public void Rollback(Enlistment enlistment)
{
enlistment.Done();
}
public void InDoubt(Enlistment enlistment)
{
enlistment.Done();
}
}
Transaction.Current.EnlistDurable(DummyEnlistmentNotification.Id, new DummyEnlistmentNotification(),
EnlistmentOptions.None);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment