public IServerStatementPlan PrepareStatement(DataParams paramsValue) { PlanDescriptor planDescriptor; IRemoteServerStatementPlan plan = _batch.PrepareStatement(((LocalProcess)ServerProcess).DataParamsToRemoteParams(paramsValue), out planDescriptor); return(new LocalStatementPlan(_script._process, plan, planDescriptor)); }
/// <summary> Prepares the given statement for execution. </summary> /// <param name='statement'> A single valid Dataphor statement to prepare. </param> /// <returns> An <see cref="IServerStatementPlan"/> instance for the prepared statement. </returns> public IServerStatementPlan PrepareStatement(string statement, DataParams paramsValue, DebugLocator locator) { PlanDescriptor planDescriptor; IRemoteServerStatementPlan plan = _process.PrepareStatement(statement, DataParamsToRemoteParams(paramsValue), locator, out planDescriptor, GetProcessCleanupInfo()); return(new LocalStatementPlan(this, plan, planDescriptor)); }
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); }
public void UnprepareStatement(IRemoteServerStatementPlan plan) { try { _serverProcess.UnprepareStatement(((RemoteServerStatementPlan)plan).ServerStatementPlan); } catch (Exception E) { throw WrapException(E); } }
public void Execute(ref RemoteParamData paramsValue, ProcessCallInfo callInfo) { _script.Process.ProcessCallInfo(callInfo); try { RemoteParam[] localParamsValue = new RemoteParam[paramsValue.Params == null ? 0 : paramsValue.Params.Length]; for (int index = 0; index < (paramsValue.Params == null ? 0 : paramsValue.Params.Length); index++) { localParamsValue[index].Name = paramsValue.Params[index].Name; localParamsValue[index].TypeName = paramsValue.Params[index].TypeName; localParamsValue[index].Modifier = paramsValue.Params[index].Modifier; } if (IsExpression()) { PlanDescriptor planDescriptor; IRemoteServerExpressionPlan plan = PrepareExpression(localParamsValue, out planDescriptor); try { ProgramStatistics programStatistics; plan.Close(plan.Open(ref paramsValue, out programStatistics, _script.Process.EmptyCallInfo()), _script.Process.EmptyCallInfo()); // TODO: Provide a mechanism for determining whether or not an expression should be evaluated or opened through the remoting CLI. } finally { UnprepareExpression(plan); } } else { PlanDescriptor planDescriptor; IRemoteServerStatementPlan plan = PrepareStatement(localParamsValue, out planDescriptor); try { ProgramStatistics programStatistics; plan.Execute(ref paramsValue, out programStatistics, callInfo); } finally { UnprepareStatement(plan); } } } catch (Exception E) { throw WrapException(E); } }
public void UnprepareStatement(IRemoteServerStatementPlan plan) { try { var channel = GetServiceInterface(); IAsyncResult result = channel.BeginUnprepareStatement(((ClientPlan)plan).PlanHandle, null, null); result.AsyncWaitHandle.WaitOne(); channel.EndUnprepareStatement(result); } 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 void UnprepareStatement(IRemoteServerStatementPlan plan) { _script.Process.UnprepareStatement(plan); }
public void UnprepareStatement(IRemoteServerStatementPlan plan) { Unprepare(plan); }