Exemple #1
0
 public override void EraseDataChunk()
 {
     if (!base.m_dataSet.IsReferenceToSharedDataSet && this.m_canWriteDataChunk)
     {
         RuntimeDataSet.EraseDataChunk(base.m_odpContext, base.m_dataSetInstance, ref this.m_dataChunkWriter);
     }
 }
        private bool RunEmbeddedQuery(List <AspNetCore.ReportingServices.ReportIntermediateFormat.ParameterValue> queryParams, object[] paramValues)
        {
            Global.Tracer.Assert(base.m_odpContext.StateManager.ExecutedQueryCache == null, "When query execution caching is enabled, new queries must not be run outside query prefetch.");
            IDataReader reader = base.RunLiveQuery(queryParams, paramValues);

            return(RuntimeDataSet.ReaderExtensionsSupported(reader));
        }
 public override void EraseDataChunk()
 {
     if (this.WritesDataChunk)
     {
         RuntimeDataSet.EraseDataChunk(base.m_odpContext, base.m_dataSetInstance, ref this.m_dataChunkWriter);
     }
 }
        private bool TakeOwnershipFromExistingQuery(ExecutedQuery query)
        {
            IDataReader dataReader = null;

            try
            {
                base.m_executionMetrics.Add(query.ExecutionMetrics);
                base.m_executionMetrics.CommandText = query.ExecutionMetrics.CommandText;
                query.ReleaseOwnership(ref base.m_command, ref base.m_commandWrappedForCancel, ref dataReader);
                this.ExtractRewrittenCommandText(base.m_command);
                this.StoreDataReader(dataReader, query.ErrorInspector);
                return(RuntimeDataSet.ReaderExtensionsSupported(dataReader));
            }
            catch (RSException)
            {
                this.EagerInlineReaderCleanup(ref dataReader);
                throw;
            }
            catch (Exception e)
            {
                if (AsynchronousExceptionDetection.IsStoppingException(e))
                {
                    throw;
                }
                this.EagerInlineReaderCleanup(ref dataReader);
                throw;
            }
        }
 protected bool CheckNoRows(RuntimeDataSet runtimeDataSet)
 {
     if (runtimeDataSet == null)
     {
         return(false);
     }
     return(runtimeDataSet.NoRows);
 }
        protected override void StoreDataReader(IDataReader reader, DataSourceErrorInspector errorInspector)
        {
            bool readerExtensionsSupportedLocal = RuntimeDataSet.ReaderExtensionsSupported(reader);

            if (reader.FieldCount > 0 || base.m_odpContext.IsSharedDataSetExecutionOnly)
            {
                this.CreateProcessingDataReader(reader, errorInspector, readerExtensionsSupportedLocal);
            }
            else
            {
                this.EagerInlineReaderCleanup(ref reader);
                base.DisposeCommand();
            }
        }
Exemple #7
0
        private void ExecuteParallelDataSets()
        {
            ThreadSet threadSet = new ThreadSet(base.m_runtimeDataSets.Count - 1);

            try
            {
                for (int i = 1; i < base.m_runtimeDataSets.Count; i++)
                {
                    RuntimeAtomicDataSet runtimeAtomicDataSet = (RuntimeAtomicDataSet)base.m_runtimeDataSets[i];
                    runtimeAtomicDataSet.InitProcessingParams(null, base.m_transaction);
                    threadSet.TryQueueWorkItem(base.m_odpContext, runtimeAtomicDataSet.ProcessConcurrent);
                }
                RuntimeAtomicDataSet runtimeAtomicDataSet2 = (RuntimeAtomicDataSet)base.m_runtimeDataSets[0];
                runtimeAtomicDataSet2.InitProcessingParams(base.m_connection, base.m_transaction);
                runtimeAtomicDataSet2.ProcessConcurrent(null);
            }
            catch (Exception e)
            {
                if (base.m_odpContext.AbortInfo != null)
                {
                    base.m_odpContext.AbortInfo.SetError(e, base.m_odpContext.ProcessingAbortItemUniqueIdentifier);
                }
                throw;
            }
            finally
            {
                threadSet.WaitForCompletion();
                threadSet.Dispose();
            }
            if (this.NeedsExecutionLogging && base.m_odpContext.JobContext != null)
            {
                DataProcessingMetrics dataProcessingMetrics = null;
                for (int j = 0; j < base.m_runtimeDataSets.Count; j++)
                {
                    RuntimeDataSet runtimeDataSet = base.m_runtimeDataSets[j];
                    if (dataProcessingMetrics == null || runtimeDataSet.DataSetExecutionMetrics.TotalDurationMs > dataProcessingMetrics.TotalDurationMs)
                    {
                        dataProcessingMetrics = runtimeDataSet.DataSetExecutionMetrics;
                    }
                }
                base.m_executionMetrics.Add(dataProcessingMetrics);
            }
        }
        protected override List <RuntimeDataSet> CreateRuntimeDataSets()
        {
            int count = base.DataSourceDefinition.DataSets.Count;
            List <RuntimeDataSet> list = new List <RuntimeDataSet>(count);

            for (int i = 0; i < count; i++)
            {
                DataSet        dataSet        = base.DataSourceDefinition.DataSets[i];
                RuntimeDataSet runtimeDataSet = null;
                if (!dataSet.UsedOnlyInParameters)
                {
                    this.m_initialNoRowsState = true;
                }
                if (!dataSet.UsedOnlyInParameters || base.DataSourceDefinition.Transaction)
                {
                    if (base.OdpContext.InSubreport && base.OdpContext.FoundExistingSubReportInstance)
                    {
                        DataSetInstance dataSetInstance = base.OdpContext.GetDataSetInstance(dataSet);
                        this.m_initialNoRowsState &= dataSetInstance.NoRows;
                    }
                    else
                    {
                        DataSetInstance dataSetInstance2 = new DataSetInstance(dataSet);
                        this.m_reportInstance.SetDataSetInstance(dataSetInstance2);
                        if (dataSet.IndexInCollection == base.ReportDefinition.FirstDataSetIndexToProcess && !dataSet.UsedOnlyInParameters)
                        {
                            runtimeDataSet = new RuntimeOnDemandDataSet(base.DataSourceDefinition, dataSet, dataSetInstance2, base.OdpContext, true, true, true);
                        }
                        else
                        {
                            bool processRetrievedData = !dataSet.UsedOnlyInParameters;
                            runtimeDataSet = new RuntimePrefetchDataSet(base.DataSourceDefinition, dataSet, dataSetInstance2, base.OdpContext, true, processRetrievedData);
                        }
                    }
                }
                if (runtimeDataSet != null)
                {
                    list.Add(runtimeDataSet);
                }
            }
            return(list);
        }