public LocalSession(LocalServer server, SessionInfo sessionInfo, IRemoteServerSession session) : base() { _server = server; _session = session; _sessionInfo = sessionInfo; _sessionID = session.SessionID; _internalSession = ((IServer)_server._internalServer).Connect(new SessionInfo(Engine.SystemUserID, String.Empty, Engine.SystemLibraryName, false)); StartKeepAlive(); }
private void CacheCleared(LocalServer server) { if (_dataTypes != null) { _dataTypes.OnCatalogLookupFailed -= new Schema.CatalogLookupFailedEvent(CatalogLookupFailed); } _dataTypes = new Schema.DataTypes(server._internalServer.Catalog); _dataTypes.OnCatalogLookupFailed += new Schema.CatalogLookupFailedEvent(CatalogLookupFailed); _session._server.Catalog.ClassLoader.OnMiss += new ClassLoaderMissedEvent(ClassLoaderMissed); }
private void DropDataType() { if (_tableVar is Schema.DerivedTableVar) { LocalServer.AcquireCacheLock(_process, LockMode.Exclusive); try { Program program = new Program(_process._internalProcess); program.Code = new DropViewNode((Schema.DerivedTableVar)_tableVar); program.Execute(null); } finally { LocalServer.ReleaseCacheLock(_process, LockMode.Exclusive); } } }
private Schema.IDataType GetDataType() { bool timeStampSet = false; try { LocalServer.WaitForCacheTimeStamp(_process, _descriptor.CacheChanged ? _descriptor.ClientCacheTimeStamp - 1 : _descriptor.ClientCacheTimeStamp); LocalServer.AcquireCacheLock(_process, _descriptor.CacheChanged ? LockMode.Exclusive : LockMode.Shared); try { if (_descriptor.CacheChanged) { LocalServer.EnsureCacheConsistent(_descriptor.CacheTimeStamp); try { if (_descriptor.Catalog != String.Empty) { IServerScript script = ((IServerProcess)_process._internalProcess).PrepareScript(_descriptor.Catalog); try { script.Execute(_params); } finally { ((IServerProcess)_process._internalProcess).UnprepareScript(script); } } } finally { LocalServer.SetCacheTimeStamp(_process, _descriptor.ClientCacheTimeStamp); timeStampSet = true; } } if (LocalServer.Catalog.ContainsName(_descriptor.ObjectName)) { Schema.Object objectValue = LocalServer.Catalog[_descriptor.ObjectName]; if (objectValue is Schema.TableVar) { _tableVar = (Schema.TableVar)objectValue; Plan plan = new Plan(_process._internalProcess); try { if (_params != null) { foreach (DataParam param in _params) { plan.Symbols.Push(new Symbol(param.Name, param.DataType)); } } foreach (DataParam param in _process._internalProcess.ProcessLocals) { plan.Symbols.Push(new Symbol(param.Name, param.DataType)); } _tableNode = (TableNode)Compiler.EmitTableVarNode(plan, _tableVar); } finally { plan.Dispose(); } _dataType = _tableVar.DataType; } else { _dataType = (Schema.IDataType)objectValue; } } else { try { Plan plan = new Plan(_process._internalProcess); try { _dataType = Compiler.CompileTypeSpecifier(plan, new DAE.Language.D4.Parser().ParseTypeSpecifier(_descriptor.ObjectName)); } finally { plan.Dispose(); } } catch { // Notify the server that the client cache is out of sync Process.Execute(".System.UpdateTimeStamps();", null); throw; } } return(_dataType); } finally { LocalServer.ReleaseCacheLock(_process, _descriptor.CacheChanged ? LockMode.Exclusive : LockMode.Shared); } } catch (Exception E) { // Notify the server that the client cache is out of sync Process.Execute(".System.UpdateTimeStamps();", null); E = new ServerException(ServerException.Codes.CacheDeserializationError, E, _descriptor.ClientCacheTimeStamp); LocalServer._internalServer.LogError(E); throw E; } finally { if (!timeStampSet) { LocalServer.SetCacheTimeStamp(_process, _descriptor.ClientCacheTimeStamp); } } }
private void CacheClearing(LocalServer server) { server._internalServer.Catalog.ClassLoader.OnMiss -= new ClassLoaderMissedEvent(ClassLoaderMissed); }