// OpenCursor public IRemoteServerCursor OpenCursor ( string expression, ref RemoteParamData paramsValue, out IRemoteServerExpressionPlan plan, out PlanDescriptor planDescriptor, out ProgramStatistics executeTime, ProcessCallInfo callInfo, RemoteProcessCleanupInfo cleanupInfo, out Guid[] bookmarks, int count, out RemoteFetchData fetchData ) { ProcessCallInfo(callInfo); plan = PrepareExpression(expression, paramsValue.Params, null, out planDescriptor, cleanupInfo); try { IRemoteServerCursor cursor = plan.Open(ref paramsValue, out executeTime, EmptyCallInfo()); fetchData = cursor.Fetch(out bookmarks, count, true, EmptyCallInfo()); return(cursor); } catch { UnprepareExpression(plan); plan = null; throw; } }
public IRemoteServerPlan Prepare(RemoteParam[] paramsValue) { try { var channel = GetServiceInterface(); IAsyncResult result = channel.BeginPrepareBatch(BatchHandle, paramsValue, null, null); result.AsyncWaitHandle.WaitOne(); PlanDescriptor planDescriptor = channel.EndPrepareBatch(result); if (IsExpression()) { return(new ClientExpressionPlan(_clientScript.ClientProcess, planDescriptor)); } else { return(new ClientStatementPlan(_clientScript.ClientProcess, planDescriptor)); } } catch (FaultException <DataphorFault> fault) { throw DataphorFaultUtility.FaultToException(fault.Detail); } catch (CommunicationException ce) { ReportCommunicationError(); throw new ServerException(ServerException.Codes.CommunicationFailure, ErrorSeverity.Environment, ce); } }
internal PlanDescriptor GetPlanDescriptor(IRemoteServerStatementPlan plan) { PlanDescriptor descriptor = new PlanDescriptor(); descriptor.ID = plan.ID; descriptor.CacheTimeStamp = plan.Process.Session.Server.CacheTimeStamp; descriptor.Statistics = plan.PlanStatistics; descriptor.Messages = DataphorFaultUtility.ExceptionsToFaults(plan.Messages); return(descriptor); }
// OpenCursor public IRemoteServerCursor OpenCursor ( string expression, ref RemoteParamData paramsValue, out IRemoteServerExpressionPlan plan, out PlanDescriptor planDescriptor, out ProgramStatistics executeTime, ProcessCallInfo callInfo, RemoteProcessCleanupInfo cleanupInfo ) { ProcessCallInfo(callInfo); plan = PrepareExpression(expression, paramsValue.Params, null, out planDescriptor, cleanupInfo); try { return(plan.Open(ref paramsValue, out executeTime, EmptyCallInfo())); } catch { UnprepareExpression(plan); plan = null; throw; } }
internal PlanDescriptor GetPlanDescriptor(RemoteServerExpressionPlan plan, RemoteParam[] paramsValue) { PlanDescriptor descriptor = new PlanDescriptor(); descriptor.ID = plan.ID; descriptor.Statistics = plan.PlanStatistics; descriptor.Messages = DataphorFaultUtility.ExceptionsToFaults(plan.Messages); if (plan.ServerExpressionPlan.ActualDataType is Schema.ICursorType) { descriptor.Capabilities = plan.Capabilities; descriptor.CursorIsolation = plan.Isolation; descriptor.CursorType = plan.CursorType; if (((TableNode)plan.ServerExpressionPlan.Program.Code.Nodes[0]).Order != null) { descriptor.Order = ((TableNode)plan.ServerExpressionPlan.Program.Code.Nodes[0]).Order.Name; } else { descriptor.Order = String.Empty; } } descriptor.Catalog = plan.GetCatalog(paramsValue, out descriptor.ObjectName, out descriptor.CacheTimeStamp, out descriptor.ClientCacheTimeStamp, out descriptor.CacheChanged); return(descriptor); }
public IRemoteServerExpressionPlan PrepareExpression(string expression, RemoteParam[] paramsValue, DebugLocator locator, out PlanDescriptor planDescriptor, RemoteProcessCleanupInfo cleanupInfo) { try { CleanupPlans(cleanupInfo); RemoteServerExpressionPlan remotePlan = new RemoteServerExpressionPlan(this, (ServerExpressionPlan)_serverProcess.PrepareExpression(expression, RemoteParamsToDataParams(paramsValue), locator)); planDescriptor = GetPlanDescriptor(remotePlan, paramsValue); return(remotePlan); } catch (Exception E) { throw WrapException(E); } }
public IRemoteServerStatementPlan PrepareStatement(string statement, RemoteParam[] paramsValue, DebugLocator locator, out PlanDescriptor planDescriptor, RemoteProcessCleanupInfo cleanupInfo) { try { CleanupPlans(cleanupInfo); ServerStatementPlan statementPlan = (ServerStatementPlan)_serverProcess.PrepareStatement(statement, RemoteParamsToDataParams(paramsValue), locator); RemoteServerStatementPlan remotePlan = new RemoteServerStatementPlan(this, statementPlan); planDescriptor = GetPlanDescriptor(remotePlan); return(remotePlan); } catch (Exception E) { throw WrapException(E); } }
public ClientPlan(ClientProcess clientProcess, PlanDescriptor planDescriptor) { _clientProcess = clientProcess; _planDescriptor = planDescriptor; }
public LocalPlan(LocalProcess process, IRemoteServerPlan plan, PlanDescriptor planDescriptor) : base() { _process = process; _plan = plan; _descriptor = planDescriptor; }
public byte[] Evaluate(string expression, ref RemoteParamData paramsValue, out IRemoteServerExpressionPlan plan, out PlanDescriptor planDescriptor, out ProgramStatistics executeTime, ProcessCallInfo callInfo, RemoteProcessCleanupInfo cleanupInfo) { try { var channel = GetServiceInterface(); IAsyncResult result = channel.BeginEvaluateExpression(ProcessHandle, GetCleanupInfo(cleanupInfo), callInfo, expression, paramsValue, null, null); result.AsyncWaitHandle.WaitOne(); DirectEvaluateResult evaluateResult = channel.EndEvaluateExpression(result); paramsValue.Data = evaluateResult.ParamData; planDescriptor = evaluateResult.PlanDescriptor; executeTime = evaluateResult.ExecuteTime; plan = new ClientExpressionPlan(this, planDescriptor); return(evaluateResult.Result); } catch (FaultException <DataphorFault> fault) { throw DataphorFaultUtility.FaultToException(fault.Detail); } catch (CommunicationException ce) { ReportCommunicationError(); throw new ServerException(ServerException.Codes.CommunicationFailure, ErrorSeverity.Environment, ce); } }
public IRemoteServerExpressionPlan PrepareExpression(string expression, RemoteParam[] paramsValue, DebugLocator locator, out PlanDescriptor planDescriptor, RemoteProcessCleanupInfo cleanupInfo) { try { var channel = GetServiceInterface(); IAsyncResult result = channel.BeginPrepareExpression(ProcessHandle, GetCleanupInfo(cleanupInfo), expression, paramsValue, locator, null, null); result.AsyncWaitHandle.WaitOne(); planDescriptor = channel.EndPrepareExpression(result); return(new ClientExpressionPlan(this, planDescriptor)); } catch (FaultException <DataphorFault> fault) { throw DataphorFaultUtility.FaultToException(fault.Detail); } catch (CommunicationException ce) { ReportCommunicationError(); throw new ServerException(ServerException.Codes.CommunicationFailure, ErrorSeverity.Environment, ce); } }
public IRemoteServerStatementPlan PrepareStatement(RemoteParam[] paramsValue, out PlanDescriptor planDescriptor) { try { DataParams localParamsValue = _script.Process.RemoteParamsToDataParams(paramsValue); RemoteServerStatementPlan remotePlan = new RemoteServerStatementPlan(_script.Process, (ServerStatementPlan)_serverBatch.PrepareStatement(localParamsValue)); planDescriptor = _script.Process.GetPlanDescriptor(remotePlan); return(remotePlan); } catch (Exception E) { throw WrapException(E); } }
public IRemoteServerStatementPlan PrepareStatement(RemoteParam[] paramsValue, out PlanDescriptor planDescriptor) { ClientPlan plan = (ClientPlan)Prepare(paramsValue); planDescriptor = plan.PlanDescriptor; return((IRemoteServerStatementPlan)plan); }
public IRemoteServerExpressionPlan PrepareExpression(RemoteParam[] paramsValue, out PlanDescriptor planDescriptor) { ClientPlan plan = (ClientPlan)Prepare(paramsValue); planDescriptor = plan.PlanDescriptor; return((IRemoteServerExpressionPlan)plan); }
public ClientStatementPlan(ClientProcess clientProcess, PlanDescriptor planDescriptor) : base(clientProcess, planDescriptor) { }
public LocalExpressionPlan(LocalProcess process, IRemoteServerExpressionPlan plan, PlanDescriptor planDescriptor, DataParams paramsValue, ProgramStatistics executeTime) : this(process, plan, planDescriptor, paramsValue) { _programStatistics = executeTime; _programStatisticsCached = true; }
public LocalExpressionPlan(LocalProcess process, IRemoteServerExpressionPlan plan, PlanDescriptor planDescriptor, DataParams paramsValue) : base(process, plan, planDescriptor) { _plan = plan; _params = paramsValue; _internalPlan = new Plan(_process._internalProcess); GetDataType(); }
public IRemoteServerCursor OpenCursor(string expression, ref RemoteParamData paramsValue, out IRemoteServerExpressionPlan plan, out PlanDescriptor planDescriptor, out ProgramStatistics executeTime, ProcessCallInfo callInfo, RemoteProcessCleanupInfo cleanupInfo, out Guid[] bookmarks, int count, out RemoteFetchData fetchData) { try { var channel = GetServiceInterface(); IAsyncResult result = channel.BeginOpenCursorWithFetch(ProcessHandle, GetCleanupInfo(cleanupInfo), callInfo, expression, paramsValue, count, null, null); result.AsyncWaitHandle.WaitOne(); DirectCursorWithFetchResult cursorResult = channel.EndOpenCursorWithFetch(result); paramsValue.Data = cursorResult.ParamData; planDescriptor = cursorResult.PlanDescriptor; executeTime = cursorResult.ExecuteTime; bookmarks = cursorResult.Bookmarks; fetchData = cursorResult.FetchData; plan = new ClientExpressionPlan(this, planDescriptor); return(new ClientCursor((ClientExpressionPlan)plan, cursorResult.CursorDescriptor)); } catch (FaultException <DataphorFault> fault) { throw DataphorFaultUtility.FaultToException(fault.Detail); } catch (CommunicationException ce) { ReportCommunicationError(); throw new ServerException(ServerException.Codes.CommunicationFailure, ErrorSeverity.Environment, ce); } }
public LocalStatementPlan(LocalProcess process, IRemoteServerStatementPlan plan, PlanDescriptor planDescriptor) : base(process, plan, planDescriptor) { _plan = plan; }
public ClientExpressionPlan(ClientProcess clientProcess, PlanDescriptor planDescriptor) : base(clientProcess, planDescriptor) { }