public static ProcessCleanupInfo GetCleanupInfo(RemoteProcessCleanupInfo cleanupInfo) { try { ProcessCleanupInfo localCleanupInfo = new ProcessCleanupInfo(); localCleanupInfo.UnprepareList = new int[cleanupInfo.UnprepareList.Length]; for (int index = 0; index < localCleanupInfo.UnprepareList.Length; index++) { localCleanupInfo.UnprepareList[index] = ((ClientPlan)cleanupInfo.UnprepareList[index]).PlanHandle; } return(localCleanupInfo); } catch (FaultException <DataphorFault> fault) { throw DataphorFaultUtility.FaultToException(fault.Detail); } catch (CommunicationException ce) { throw new ServerException(ServerException.Codes.CommunicationFailure, ErrorSeverity.Environment, ce); } }
// 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; } }
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); } }
// Execute public void Execute(string statement, ref RemoteParamData paramsValue, ProcessCallInfo callInfo, RemoteProcessCleanupInfo cleanupInfo) { ProcessCallInfo(callInfo); DataParams localParamsValue = RemoteParamsToDataParams(paramsValue.Params); _serverProcess.Execute(statement, localParamsValue); DataParamsToRemoteParamData(localParamsValue, ref paramsValue); }
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 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 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 void Execute(string statement, ref RemoteParamData paramsValue, ProcessCallInfo callInfo, RemoteProcessCleanupInfo cleanupInfo) { try { var channel = GetServiceInterface(); IAsyncResult result = channel.BeginExecuteStatement(ProcessHandle, GetCleanupInfo(cleanupInfo), callInfo, statement, paramsValue, null, null); result.AsyncWaitHandle.WaitOne(); ExecuteResult executeResult = channel.EndExecuteStatement(result); paramsValue.Data = executeResult.ParamData; } catch (FaultException <DataphorFault> fault) { throw DataphorFaultUtility.FaultToException(fault.Detail); } catch (CommunicationException ce) { ReportCommunicationError(); throw new ServerException(ServerException.Codes.CommunicationFailure, ErrorSeverity.Environment, ce); } }