public void Close()
        {
            IDataReader dataReader = Interlocked.Exchange <IDataReader>(ref this.m_dataReader, (IDataReader)null);

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

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

            if (dbConnection != null)
            {
                RuntimeDataSource.CloseConnection(dbConnection, this.m_dataSource, this.m_odpContext, this.m_executionMetrics);
            }
        }
 public static void DisposeDataExtensionObject <T>(ref T obj, string objectType, string dataSetName) where T : class, IDisposable
 {
     QueryExecutionUtils.DisposeDataExtensionObject <T>(ref obj, objectType, dataSetName, (DataProcessingMetrics)null, (DataProcessingMetrics.MetricType?)null);
 }
예제 #3
0
 protected void DisposeDataExtensionObject <T>(ref T obj, string objectType, DataProcessingMetrics.MetricType?metricType) where T : class, IDisposable
 {
     QueryExecutionUtils.DisposeDataExtensionObject <T>(ref obj, objectType, this.m_dataSet.Name.MarkAsPrivate(), this.m_executionMetrics, metricType);
 }
예제 #4
0
 protected void DisposeDataExtensionObject <T>(ref T obj, string objectType) where T : class, IDisposable
 {
     QueryExecutionUtils.DisposeDataExtensionObject <T>(ref obj, objectType, this.m_dataSet.Name.MarkAsPrivate());
 }