示例#1
0
 protected void UnprepareRootPlan()
 {
     if (_rootPlan != null)
     {
         _process.UnprepareExpression(_rootPlan);
         _rootParams = null;
         _rootPlan   = null;
     }
 }
示例#2
0
 public void Unprepare()
 {
     if (_plan != null)
     {
         if (_cursor != null)
         {
             try
             {
                 _process.CloseCursor(_cursor);
             }
             finally
             {
                 _cursor = null;
             }
         }
         else
         {
             try
             {
                 _process.UnprepareExpression(_plan);
             }
             finally
             {
                 _plan = null;
             }
         }
     }
 }
示例#3
0
        /// <summary>Evaluates the given expression using the given process and returns the result.</summary>
        public DAE.Runtime.Data.IDataValue EvaluateRaw(IServerProcess process, string expression, DAE.Runtime.DataParams paramsValue)
        {
            CheckActive();

            if (process == null)
            {
                process = UtilityProcess;
            }

            IServerExpressionPlan plan = process.PrepareExpression(expression, paramsValue);

            try
            {
                return(plan.Evaluate(paramsValue));
            }
            finally
            {
                process.UnprepareExpression(plan);
            }
        }
示例#4
0
        /// <summary>Opens a cursor on the given expression using the given process.</summary>
        public IServerCursor OpenCursor(IServerProcess process, string expression, DAE.Runtime.DataParams paramsValue)
        {
            CheckActive();

            if (process == null)
            {
                process = UtilityProcess;
            }

            IServerExpressionPlan plan = process.PrepareExpression(expression, paramsValue);

            try
            {
                return(plan.Open(paramsValue));
            }
            catch
            {
                process.UnprepareExpression(plan);
                throw;
            }
        }
示例#5
0
        public DAE.Runtime.Data.Scalar EvaluateScalar(IServerProcess process, string expression, DAE.Runtime.DataParams paramsValue)
        {
            if (process == null)
            {
                process = DataSession.UtilityProcess;
            }

            DAE.IServerExpressionPlan plan = process.PrepareExpression(expression, paramsValue);
            try
            {
                ErrorList errors = new ErrorList();
                errors.AddRange(plan.Messages);
                ReportErrors(null, errors);

                return((DAE.Runtime.Data.Scalar)plan.Evaluate(paramsValue));
            }
            finally
            {
                process.UnprepareExpression(plan);
            }
        }
示例#6
0
 public void UnPrepare()
 {
     _preparedCommandText = String.Empty;
     _dAERuntimeParams    = null;
     if (_plan != null)
     {
         IServerProcess planProcess = _plan.Process;
         if (planProcess != null)
         {
             if (_plan is IServerExpressionPlan)
             {
                 planProcess.UnprepareExpression((IServerExpressionPlan)_plan);
             }
             else
             {
                 planProcess.UnprepareStatement((IServerStatementPlan)_plan);
             }
         }
         _plan = null;
     }
 }