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);
     }
 }
Exemple #2
0
 protected internal RemoteServerStatementPlan(RemoteServerProcess process, ServerStatementPlan plan) : base(process, plan)
 {
 }
Exemple #3
0
        private void DropSessionObjects()
        {
            if (HasSessionObjects())
            {
                List <String> objectNames = new List <String>();
                for (int index = 0; index < _sessionObjects.Count; index++)
                {
                    objectNames.Add(((Schema.SessionObject)_sessionObjects[index]).GlobalName);
                }

                for (int index = 0; index < _sessionOperators.Count; index++)
                {
                    _server._systemProcess.CatalogDeviceSession.ResolveOperatorName(((Schema.SessionObject)_sessionOperators[index]).GlobalName);
                    OperatorMap operatorMap = _server.Catalog.OperatorMaps[((Schema.SessionObject)_sessionOperators[index]).GlobalName];
                    foreach (OperatorSignature signature in operatorMap.Signatures.Signatures.Values)
                    {
                        objectNames.Add(signature.Operator.Name);
                    }
                }

                string[] objectNameArray = new string[objectNames.Count];
                for (int index = 0; index < objectNames.Count; index++)
                {
                    objectNameArray[index] = objectNames[index];
                }

                Block block = (Block)_server.Catalog.EmitDropStatement(_server._systemProcess.CatalogDeviceSession, objectNameArray, String.Empty);

                _server._systemProcess.BeginCall();
                try
                {
                    ServerStatementPlan plan = new ServerStatementPlan(_server._systemProcess);
                    try
                    {
                        // Push a timestamp safe context to prevent the drops from flushing cache-points
                        plan.Plan.EnterTimeStampSafeContext();
                        try
                        {
                            for (int index = 0; index < block.Statements.Count; index++)
                            {
                                plan.Program.Code = Compiler.Compile(plan.Plan, block.Statements[index]);
                                plan.Program.Execute(null);
                            }
                        }
                        finally
                        {
                            plan.Plan.ExitTimeStampSafeContext();
                        }
                    }
                    finally
                    {
                        plan.Dispose();
                    }
                }
                catch (Exception E)
                {
                    throw WrapException(E);
                }
                finally
                {
                    _server._systemProcess.EndCall();
                }

                //FServer.RunScript(new D4TextEmitter().Emit(FServer.Catalog.EmitDropStatement(FServer.FSystemProcess, LObjectNameArray, String.Empty)), FCurrentLibrary.Name);
            }
        }