示例#1
0
 protected void CloseConnection()
 {
     if (m_isConnectionOwner && m_dataSourceConnection != null)
     {
         RuntimeDataSource.CloseConnection(m_dataSourceConnection, m_dataSource, m_odpContext, m_executionMetrics);
         m_dataSourceConnection = null;
     }
 }
示例#2
0
        internal void Close()
        {
            IDataReader obj = Interlocked.Exchange(ref m_dataReader, null);

            if (obj != null)
            {
                QueryExecutionUtils.DisposeDataExtensionObject(ref obj, "data reader", m_dataSet.Name, m_executionMetrics, DataProcessingMetrics.MetricType.DisposeDataReader);
            }
            m_commandWrappedForCancel = null;
            IDbCommand obj2 = Interlocked.Exchange(ref m_command, null);

            if (obj2 != null)
            {
                QueryExecutionUtils.DisposeDataExtensionObject(ref obj2, "command", m_dataSet.Name);
            }
            IDbConnection dbConnection = Interlocked.Exchange(ref m_connection, null);

            if (dbConnection != null)
            {
                RuntimeDataSource.CloseConnection(dbConnection, m_dataSource, m_odpContext, m_executionMetrics);
            }
        }