Beispiel #1
0
        /// <summary>
        /// Yields the current program to the debugger if a breakpoint or break condition is satisfied.
        /// </summary>
        public void Yield(ServerProcess process, PlanNode node)
        {
            if (!process.IsLoading())
            {
                try
                {
                    Monitor.Enter(_syncHandle);
                    try
                    {
                        if (ShouldBreak(process, node))
                        {
                            _brokenProcesses.Add(process);
                            InternalPause();
                        }

                        while (_isPauseRequested && _processes.Contains(process))
                        {
                            _pausedCount++;
                            Monitor.Exit(_syncHandle);
                            try
                            {
                                                                #if !SILVERLIGHT
                                WaitHandle.SignalAndWait(_waitSignal, _pauseSignal);
                                                                #endif
                            }
                            finally
                            {
                                Monitor.Enter(_syncHandle);
                                _pausedCount--;
                            }
                        }
                    }
                    finally
                    {
                        Monitor.Exit(_syncHandle);
                    }
                }
                catch
                {
                    // Do nothing, no error should ever be thrown from here
                }
            }
        }
Beispiel #2
0
        protected override object InternalExecute(Program program, PlanNode planNode)
        {
            if ((planNode is BaseTableVarNode) || (planNode is OrderNode))
            {
                Schema.TableVar tableVar = null;
                if (planNode is BaseTableVarNode)
                {
                    tableVar = ((BaseTableVarNode)planNode).TableVar;
                }
                else if (planNode is OrderNode)
                {
                    tableVar = ((BaseTableVarNode)planNode.Nodes[0]).TableVar;
                }
                if (tableVar != null)
                {
                    Device.LoadTable(ServerProcess, tableVar);
                }
            }
            object result = base.InternalExecute(program, planNode);

            if (planNode is CreateTableNode)
            {
                Schema.TableVar    tableVar = ((CreateTableNode)planNode).Table;
                SimpleDeviceHeader header   = new SimpleDeviceHeader(tableVar, 0);
                Device.Headers.Add(header);
                if (!ServerProcess.IsLoading() && ((Device.ReconcileMode & ReconcileMode.Command) != 0))
                {
                    string fileName = Device.GetTableVarFileName(tableVar);
                    if (File.Exists(fileName))
                    {
                        File.Delete(fileName);
                    }
                }
            }
            else if (planNode is DropTableNode)
            {
                Device.Headers.Remove(((DropTableNode)planNode).Table);
            }
            return(result);
        }
Beispiel #3
0
 public bool IsLoading()
 {
     return(_serverProcess.IsLoading());
 }