| | |
| | | throw;
|
| | | }
|
| | |
|
| | | var addrContrast = AddrContrast.Instance;
|
| | | addrContrast.initialize(_mainConn);
|
| | | AddrContrast.Instance.Initialize(_mainConn);
|
| | | AlarmData.Instance.Initialize(_mainConn);
|
| | |
|
| | | CCSEventRecord ccsEventRecord = GetWaitRecord(_mainConn);
|
| | |
|
| | |
| | | GC.WaitForPendingFinalizers();
|
| | | }
|
| | |
|
| | | public void AcceptEvent2(CCSEventRecord ccsEventRecord)
|
| | | {
|
| | | // WorkItemCallback workItemCallback = new WorkItemCallback(this.DoEventWork);
|
| | | _mainjobThreadPool.QueueWorkItem(DoEventWork, ccsEventRecord);
|
| | | }
|
| | |
|
| | | private void DoEventWork(CCSEventRecord state)
|
| | | {
|
| | | OracleConnection conn;
|
| | | lock (_syncDbQueue) conn = _dbQueue.Dequeue();
|
| | |
|
| | | try
|
| | | {
|
| | | AcceptEvent(state);
|
| | | }
|
| | | finally
|
| | | {
|
| | | lock (_syncDbQueue) _dbQueue.Enqueue(conn);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | public void AcceptEvent(CCSEventRecord ccsEventRecord)
|
| | | {
|
| | | /*
|
| | | WorkItemCallback workItemCallback = new WorkItemCallback(this.DoWork);
|
| | | _mainjobThreadPool.QueueWorkItem(workItemCallback, ccsEventRecord);
|
| | | WIGStartInfo wigStartInfo = new WIGStartInfo()
|
| | | {
|
| | | FillStateWithArgs = true,
|
| | |
| | |
|
| | | if (waitCcsEventRecord != null)
|
| | | {
|
| | | OracleConnection conn = null;
|
| | | OracleConnection conn;
|
| | | lock (_syncDbQueue) conn = _dbQueue.Dequeue();
|
| | | ProcessCase(waitCcsEventRecord, conn);
|
| | | }
|
| | |
| | | {
|
| | | string file = Path.Combine(AppDataPath, DbConfigFilename);
|
| | | // 建立 XML 讀取器
|
| | | XmlReaderSettings settings = new XmlReaderSettings();
|
| | | settings.IgnoreComments = true; // 不處理註解
|
| | | settings.IgnoreWhitespace = true; // 跳過空白
|
| | | settings.ValidationType = ValidationType.None; // 不驗證任何資料
|
| | | XmlReaderSettings settings = new XmlReaderSettings
|
| | | {
|
| | | IgnoreComments = true, // 不處理註解
|
| | | IgnoreWhitespace = true, // 跳過空白
|
| | | ValidationType = ValidationType.None // 不驗證任何資料
|
| | | };
|
| | | reader = XmlReader.Create(file, settings);
|
| | |
|
| | | // 進入讀取主要部分
|
| | |
| | | {
|
| | | OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(GlobalVariable.ConnectionString)
|
| | | {
|
| | | MaxPoolSize = 20,
|
| | | MinPoolSize = 5,
|
| | | MaxPoolSize = GlobalVariable.MaxConnectionCount,
|
| | | MinPoolSize = 1,
|
| | | Pooling = true
|
| | | };
|
| | | string connectstring = builder.ToString();
|