コード例 #1
0
 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;
     }
 }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
 }
コード例 #7
0
        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;
        }
コード例 #8
0
        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;
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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;
            }
        }
コード例 #11
0
 protected virtual void InitializeRowSourceAndProcessRows(ExecutedQuery existingQuery)
 {
     if (m_dataSet.IsReferenceToSharedDataSet)
     {
         ProcessSharedDataSetReference();
         return;
     }
     if (existingQuery != null)
     {
         InitializeAndRunFromExistingQuery(existingQuery);
     }
     else
     {
         InitializeAndRunLiveQuery();
     }
     if (base.ProcessRetrievedData)
     {
         ProcessRows();
     }
 }
コード例 #12
0
 protected void InitializeDataSet(ExecutedQuery existingQuery)
 {
     RuntimeDataSet.InitProcessingParams(m_connection, m_transaction);
     RuntimeDataSet.Initialize(existingQuery);
 }
コード例 #13
0
 public void ProcessInline(ExecutedQuery existingQuery)
 {
     Process(existingQuery);
 }
コード例 #14
0
        protected void InitializeAndRunFromExistingQuery(ExecutedQuery query)
        {
            bool readerExtensionsSupported = RunFromExistingQuery(query);

            InitializeToProcessData(readerExtensionsSupported);
        }