public ProfiledDbTransaction(DbTransaction transaction, ProfiledDbConnection connection, IDbProfiler profiler) { if (transaction == null) throw new ArgumentNullException("transaction"); if (connection == null) throw new ArgumentNullException("connection"); InnerTransaction = transaction; _connection = connection; _profiler = profiler; _connectionId = UniqueIdExtensions<DbConnection>.GetUniqueId(connection.InnerConnection).ToInt(); _profiler.TransactionBegan(connection.InnerConnection, NHProfilerContextProvider.GetLoggedDbConnection(this, _connectionId)); }
protected override void Dispose(bool disposing) { _profiler.TransactionDisposing(InnerTransaction, NHProfilerContextProvider.GetLoggedDbTransaction(InnerTransaction, _connectionId)); if (disposing && InnerTransaction != null) { InnerTransaction.Dispose(); } InnerTransaction = null; _connection = null; base.Dispose(disposing); }
public ProfiledDbTransaction(DbTransaction transaction, ProfiledDbConnection connection, IDbProfiler profiler) { if (transaction == null) { throw new ArgumentNullException("transaction"); } if (connection == null) { throw new ArgumentNullException("connection"); } InnerTransaction = transaction; _connection = connection; _profiler = profiler; _connectionId = UniqueIdExtensions <DbConnection> .GetUniqueId(connection.InnerConnection).ToInt(); _profiler.TransactionBegan(connection.InnerConnection, NHProfilerContextProvider.GetLoggedDbConnection(this, _connectionId)); }