Example #1
0
        // Token: 0x06000198 RID: 408 RVA: 0x00008710 File Offset: 0x00006910
        private void AttemptAddDatabase(DatabaseInfo databaseInfo)
        {
            OnlineDatabase onlineDatabase = null;

            try
            {
                base.CatchMeIfYouCan(delegate
                {
                    onlineDatabase = new OnlineDatabase(databaseInfo, this);
                    onlineDatabase.Start();
                }, "DatabaseManager");
            }
            catch (AIException ex)
            {
                ExTraceGlobals.DatabaseManagerTracer.TraceError <DatabaseManager, AIException>((long)this.GetHashCode(), "{0}: Failed to start database. Exception={1}", this, ex);
                base.LogEvent(AssistantsEventLogConstants.Tuple_DatabaseManagerTransientFailure, ex.ToString(), new object[]
                {
                    ex.ToString()
                });
                if (onlineDatabase != null)
                {
                    onlineDatabase.Dispose();
                }
                return;
            }
            this.onlineDatabases.Add(databaseInfo.Guid, onlineDatabase);
            base.LogEvent(databaseInfo.IsPublic ? AssistantsEventLogConstants.Tuple_DatabaseManagerStartedPublicDatabase : AssistantsEventLogConstants.Tuple_DatabaseManagerStartedPrivateDatabase, null, new object[]
            {
                databaseInfo.DisplayName
            });
        }
Example #2
0
        // Token: 0x06000199 RID: 409 RVA: 0x00008810 File Offset: 0x00006A10
        private void RemoveDatabase(Guid databaseGuid, HangDetector hangDetector)
        {
            AIBreadcrumbs.DatabaseStatusTrail.Drop("Removing database " + databaseGuid);
            OnlineDatabase onlineDatabase = this.onlineDatabases[databaseGuid];

            hangDetector.DatabaseName = ((onlineDatabase == null || onlineDatabase.DatabaseInfo == null) ? null : onlineDatabase.DatabaseInfo.DisplayName);
            this.onlineDatabases.Remove(databaseGuid);
            try
            {
                onlineDatabase.Stop(hangDetector);
                base.LogEvent(AssistantsEventLogConstants.Tuple_DatabaseManagerStoppedDatabase, null, new object[]
                {
                    onlineDatabase.DatabaseInfo.DisplayName
                });
            }
            finally
            {
                onlineDatabase.Dispose();
                hangDetector.DatabaseName = null;
            }
        }