internal void Initialize(ExecutedQuery existingQuery) { try { InitializeDataSet(); if (m_dataSet.IsReferenceToSharedDataSet) { Global.Tracer.Assert(condition: false, "Shared data sets cannot be used with a RuntimeIncrementalDataSet"); } else if (existingQuery != null) { InitializeAndRunFromExistingQuery(existingQuery); } else { InitializeAndRunLiveQuery(); } } catch (Exception) { CleanupForException(); FinalCleanup(); throw; } }
private bool TakeOwnershipFromExistingQuery(ExecutedQuery query) { IDataReader dataReader = null; try { m_executionMetrics.Add(query.ExecutionMetrics); m_executionMetrics.CommandText = query.ExecutionMetrics.CommandText; query.ReleaseOwnership(ref m_command, ref m_commandWrappedForCancel, ref dataReader); ExtractRewrittenCommandText(m_command); StoreDataReader(dataReader, query.ErrorInspector); return(ReaderExtensionsSupported(dataReader)); } catch (RSException) { EagerInlineReaderCleanup(ref dataReader); throw; } catch (Exception e) { if (AsynchronousExceptionDetection.IsStoppingException(e)) { throw; } EagerInlineReaderCleanup(ref dataReader); throw; } }
private void Process(ExecutedQuery existingQuery) { InitializeDataSet(); try { try { InitializeRowSourceAndProcessRows(existingQuery); } finally { CleanupProcess(); } AllRowsRead(); TeardownDataSet(); } catch (RSException) { throw; } catch (Exception e) { if (AsynchronousExceptionDetection.IsStoppingException(e)) { throw; } CleanupForException(); throw; } finally { FinalCleanup(); } }
internal void ProcessSingleOdp() { ExecutedQuery query = null; try { m_odpContext.StateManager.ExecutedQueryCache?.Extract(m_dataSet, out query); if (InitializeDataSource(query)) { m_runtimeDataSet.InitProcessingParams(m_connection, m_transaction); m_runtimeDataSet.ProcessInline(query); m_executionMetrics.Add(m_runtimeDataSet.DataSetExecutionMetrics); if (m_totalDurationFromExistingQuery != null) { m_executionMetrics.TotalDuration.Subtract(m_totalDurationFromExistingQuery); } TeardownDataSource(); } } catch (Exception e) { HandleException(e); throw; } finally { FinalCleanup(); query?.Close(); } }
protected bool InitializeDataSource(ExecutedQuery existingQuery) { if (m_dataSource.DataSets == null || 0 >= m_dataSource.DataSets.Count) { return(false); } m_connection = null; m_transaction = null; m_needToCloseConnection = false; m_isGlobalConnection = false; m_isTransactionOwner = false; m_isGlobalTransaction = false; m_runtimeDataSets = CreateRuntimeDataSets(); if (0 >= m_runtimeDataSets.Count) { return(false); } m_canAbort = true; m_odpContext.CheckAndThrowIfAborted(); m_useConcurrentDataSetProcessing = (m_runtimeDataSets.Count > 1 && AllowConcurrentProcessing); if (!m_dataSource.IsArtificialForSharedDataSets) { if (existingQuery != null) { InitializeFromExistingQuery(existingQuery); } else { OpenInitialConnectionAndTransaction(); } } return(true); }
private void InitializeFromExistingQuery(ExecutedQuery query) { query.ReleaseOwnership(ref m_connection); m_needToCloseConnection = true; MergeAutoCollationSettings(m_connection); m_executionMetrics.Add(DataProcessingMetrics.MetricType.OpenConnection, query.ExecutionMetrics.OpenConnectionDurationMs); m_executionMetrics.ConnectionFromPool = query.ExecutionMetrics.ConnectionFromPool; m_totalDurationFromExistingQuery = new TimeMetric(query.ExecutionMetrics.TotalDuration); }
internal void Add(ExecutedQuery query) { int indexInCollection = query.DataSet.IndexInCollection; for (int i = m_queries.Count - 1; i <= indexInCollection; i++) { m_queries.Add(null); } m_queries[indexInCollection] = query; }
internal void Extract(DataSet dataSet, out ExecutedQuery query) { int indexInCollection = dataSet.IndexInCollection; if (indexInCollection >= m_queries.Count) { query = null; return; } query = m_queries[indexInCollection]; m_queries[indexInCollection] = null; }
private bool RunFromExistingQuery(ExecutedQuery query) { if (m_dataSetInstance != null) { m_dataSetInstance.SetQueryExecutionTime(query.QueryExecutionTimestamp); m_dataSetInstance.CommandText = query.CommandText; } bool result = TakeOwnershipFromExistingQuery(query); if (!m_odpContext.IsSharedDataSetExecutionOnly && m_dataSetInstance != null) { m_dataSetInstance.SaveCollationSettings(m_dataSet); UpdateReportOMDataSet(); } return(result); }
internal void Initialize() { ExecutedQuery query = null; try { m_odpContext.StateManager.ExecutedQueryCache?.Extract(m_dataSet, out query); InitializeDataSource(query); InitializeDataSet(query); } catch (Exception e) { HandleException(e); FinalCleanup(); query?.Close(); throw; } }
protected virtual void InitializeRowSourceAndProcessRows(ExecutedQuery existingQuery) { if (m_dataSet.IsReferenceToSharedDataSet) { ProcessSharedDataSetReference(); return; } if (existingQuery != null) { InitializeAndRunFromExistingQuery(existingQuery); } else { InitializeAndRunLiveQuery(); } if (base.ProcessRetrievedData) { ProcessRows(); } }
protected void InitializeDataSet(ExecutedQuery existingQuery) { RuntimeDataSet.InitProcessingParams(m_connection, m_transaction); RuntimeDataSet.Initialize(existingQuery); }
public void ProcessInline(ExecutedQuery existingQuery) { Process(existingQuery); }
protected void InitializeAndRunFromExistingQuery(ExecutedQuery query) { bool readerExtensionsSupported = RunFromExistingQuery(query); InitializeToProcessData(readerExtensionsSupported); }