/// <inheritdoc /> public virtual void Commit() { EnsureUsable(); EnsureChildrenCompleted(); if (_children?.Any(c => !c._isCommitted) == true) { throw new TransactionAbortedException("The transaction has aborted."); } _isCommitted = true; NestedTransactionManager.Remove(this); DiagnosticsLogger.Logger.LogInformation("Committed the transaction with id '{TransactionId}'.", TransactionId); }
/// <summary> /// Disposes of current transaction. /// </summary> /// <param name="disposing">Indication whether this call is made by the method <see cref="Dispose(bool)"/>.</param> protected virtual void Dispose(bool disposing) { if (!disposing) { return; } DisposeChildren(); if (!IsCompleted) { RollbackInternal(); } NestedTransactionManager.Remove(this); NestedTransactionManager = null !; _children = null; }
/// <inheritdoc /> public virtual void Rollback() { RollbackInternal(); NestedTransactionManager.Remove(this); }