Ejemplo n.º 1
0
 // 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;
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 // 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;
     }
 }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 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);
     }
 }
Ejemplo n.º 7
0
 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);
     }
 }
Ejemplo n.º 8
0
 public ClientPlan(ClientProcess clientProcess, PlanDescriptor planDescriptor)
 {
     _clientProcess  = clientProcess;
     _planDescriptor = planDescriptor;
 }
Ejemplo n.º 9
0
 public LocalPlan(LocalProcess process, IRemoteServerPlan plan, PlanDescriptor planDescriptor) : base()
 {
     _process    = process;
     _plan       = plan;
     _descriptor = planDescriptor;
 }
Ejemplo n.º 10
0
 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);
     }
 }
Ejemplo n.º 11
0
 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);
     }
 }
Ejemplo n.º 12
0
 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);
     }
 }
Ejemplo n.º 13
0
        public IRemoteServerStatementPlan PrepareStatement(RemoteParam[] paramsValue, out PlanDescriptor planDescriptor)
        {
            ClientPlan plan = (ClientPlan)Prepare(paramsValue);

            planDescriptor = plan.PlanDescriptor;
            return((IRemoteServerStatementPlan)plan);
        }
Ejemplo n.º 14
0
        public IRemoteServerExpressionPlan PrepareExpression(RemoteParam[] paramsValue, out PlanDescriptor planDescriptor)
        {
            ClientPlan plan = (ClientPlan)Prepare(paramsValue);

            planDescriptor = plan.PlanDescriptor;
            return((IRemoteServerExpressionPlan)plan);
        }
Ejemplo n.º 15
0
 public ClientStatementPlan(ClientProcess clientProcess, PlanDescriptor planDescriptor) : base(clientProcess, planDescriptor)
 {
 }
Ejemplo n.º 16
0
 public LocalExpressionPlan(LocalProcess process, IRemoteServerExpressionPlan plan, PlanDescriptor planDescriptor, DataParams paramsValue, ProgramStatistics executeTime) : this(process, plan, planDescriptor, paramsValue)
 {
     _programStatistics       = executeTime;
     _programStatisticsCached = true;
 }
Ejemplo n.º 17
0
 public LocalExpressionPlan(LocalProcess process, IRemoteServerExpressionPlan plan, PlanDescriptor planDescriptor, DataParams paramsValue) : base(process, plan, planDescriptor)
 {
     _plan         = plan;
     _params       = paramsValue;
     _internalPlan = new Plan(_process._internalProcess);
     GetDataType();
 }
Ejemplo n.º 18
0
 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);
     }
 }
Ejemplo n.º 19
0
 public LocalStatementPlan(LocalProcess process, IRemoteServerStatementPlan plan, PlanDescriptor planDescriptor) : base(process, plan, planDescriptor)
 {
     _plan = plan;
 }
Ejemplo n.º 20
0
 public ClientExpressionPlan(ClientProcess clientProcess, PlanDescriptor planDescriptor) : base(clientProcess, planDescriptor)
 {
 }