public void Commit(Enlistment enlistment) { resource.NumCommit++; if (resource.FailCommit) { if (resource.FailWithException) { throw (resource.ThrowThisException ?? new NotSupportedException()); } else { return; } } resource.Commit(); enlistment.Done(); }