/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (RealTransaction != null) { TransactionLevel = 0; RealTransaction.Dispose(); RealTransaction = null; } }
/// <summary> /// Rollbacks this instance. /// </summary> public void Rollback() { if (!IsBegined) { return; } RealTransaction.Rollback(); TransactionLevel = 0; RealTransaction.Dispose(); RealTransaction = null; }
/// <summary> /// Commits this instance. /// </summary> /// <returns></returns> public bool Commit() { if (!IsBegined) { return(true); } TransactionLevel--; if (TransactionLevel > 0) { return(true); } RealTransaction.Commit(); RealTransaction.Dispose(); RealTransaction = null; return(true); }