/// <summary>
/// Commits the transaction.
/// </summary>
public static void Commit()
{
if (_notSupported)
{
return;
}
ITransactionProvider tran = ContextHandler.GetTransaction();
if (tran == null) // !IsActive
{
throw new InvalidOperationException(); // Transaction is not Active.
}
try
{
tran.Commit();
var queue = ContextHandler.GetTransactionQueue();
if (queue != null)
{
queue.Commit();
}
OnCommitTransaction(tran, EventArgs.Empty);
}
finally
{
ContextHandler.SetTransaction(null);
ContextHandler.SetTransactionQueue(null);
tran.Dispose();
}
}