public Command(DbCommand inner, TracingDbConnection conn)
 {
     //Contract.Requires( inner != null );
     _timestamp  = Interlocked.Increment(ref _counter);
     _inner      = inner;
     _connection = conn;
 }
Exemple #2
0
        private void DisposeConnection()
        {
            if (_connection != null)
            {
                _connection.Close();
            }

            _connection = null;
        }
Exemple #3
0
        public virtual void Connect()
        {
            CheckDisposed();

            if (!IsConnected)
            {
                _connection = new TracingDbConnection(CreateConnection(), PersistenceExtension);
                if (string.IsNullOrEmpty(_connection.ConnectionString))
                {
                    _connection.ConnectionString = StorageProviderDefinition.ConnectionString;
                }

                try
                {
                    _connection.Open();
                }
                catch (Exception e)
                {
                    throw CreateRdbmsProviderException(e, "Error while opening connection.");
                }
            }
        }