Exemplo n.º 1
0
        public IServerCursor OpenCursor(string expression, DataParams paramsValue)
        {
                        #if LOGCACHEEVENTS
            FSession.FServer.FInternalServer.LogMessage(String.Format("Thread {0} opening cursor '{1}'.", Thread.CurrentThread.GetHashCode(), AExpression));
                        #endif

            RemoteParamData             localParamsValue = DataParamsToRemoteParamData(paramsValue);
            IRemoteServerExpressionPlan plan;
            IRemoteServerCursor         cursor;
            PlanDescriptor      descriptor;
            ProgramStatistics   executeTime;
            LocalExpressionPlan localPlan;
            LocalCursor         localCursor;

            if (ProcessInfo.FetchAtOpen && (ProcessInfo.FetchCount > 1))
            {
                Guid[]          bookmarks;
                RemoteFetchData fetchData;
                cursor = _process.OpenCursor(expression, ref localParamsValue, out plan, out descriptor, out executeTime, GetProcessCallInfo(), GetProcessCleanupInfo(), out bookmarks, ProcessInfo.FetchCount, out fetchData);
                RemoteParamDataToDataParams(paramsValue, localParamsValue);
                localPlan   = new LocalExpressionPlan(this, plan, descriptor, paramsValue, executeTime);
                localCursor = new LocalCursor(localPlan, cursor);
                localCursor.ProcessFetchData(fetchData, bookmarks, true);
            }
            else
            {
                cursor = _process.OpenCursor(expression, ref localParamsValue, out plan, out descriptor, out executeTime, GetProcessCallInfo(), GetProcessCleanupInfo());
                RemoteParamDataToDataParams(paramsValue, localParamsValue);
                localPlan   = new LocalExpressionPlan(this, plan, descriptor, paramsValue, executeTime);
                localCursor = new LocalCursor(localPlan, cursor);
            }
            return(localCursor);
        }
Exemplo n.º 2
0
        /// <summary>Opens a server-side cursor based on the prepared statement this plan represents.</summary>
        /// <returns>An <see cref="IServerCursor"/> instance for the prepared statement.</returns>
        public IServerCursor Open(DataParams paramsValue)
        {
            RemoteParamData     localParamsValue = ((LocalProcess)_process).DataParamsToRemoteParamData(paramsValue);
            IRemoteServerCursor serverCursor;
            LocalCursor         cursor;

            if (_process.ProcessInfo.FetchAtOpen && (_process.ProcessInfo.FetchCount > 1) && Supports(CursorCapability.Bookmarkable))
            {
                Guid[]          bookmarks;
                RemoteFetchData fetchData;
                serverCursor             = _plan.Open(ref localParamsValue, out _programStatistics, out bookmarks, _process.ProcessInfo.FetchCount, out fetchData, _process.GetProcessCallInfo());
                _programStatisticsCached = false;
                cursor = new LocalCursor(this, serverCursor);
                cursor.ProcessFetchData(fetchData, bookmarks, true);
            }
            else
            {
                serverCursor             = _plan.Open(ref localParamsValue, out _programStatistics, _process.GetProcessCallInfo());
                _programStatisticsCached = false;
                cursor = new LocalCursor(this, serverCursor);
            }
            ((LocalProcess)_process).RemoteParamDataToDataParams(paramsValue, localParamsValue);
            return(cursor);
        }