Esempio n. 1
0
 protected override void Dispose(bool disposing)
 {
     _profiler.ConnectionDisposing(InnerConnection, NHProfilerContextProvider.GetLoggedDbConnection(InnerConnection));
     if (disposing && InnerConnection != null)
     {
         InnerConnection.StateChange -= StateChangeHandler;
         InnerConnection.Dispose();
     }
     InnerConnection = null;
     base.Dispose(disposing);
 }
Esempio n. 2
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));
        }
Esempio n. 3
0
 public override void Close()
 {
     _profiler.ConnectionClosed(InnerConnection, NHProfilerContextProvider.GetLoggedDbConnection(InnerConnection));
     InnerConnection.Close();
 }
Esempio n. 4
0
 public override void Open()
 {
     _profiler.ConnectionOpened(InnerConnection, NHProfilerContextProvider.GetLoggedDbConnection(InnerConnection));
     InnerConnection.Open();
 }