Пример #1
0
 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));
 }
Пример #2
0
 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);
 }
Пример #3
0
        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));
        }
Пример #4
0
 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);
 }