private void PromoteStagingDatabase()
        {
            // This method promotes the staging database connection to a
            // production database connection (closing out the previous one
            // if one exists).
            //
            lock (promotionSyncRoot)
            {
                if (null != productionDatabase)
                {
                    productionDatabase.CloseConnection();
                    productionDatabase = null;
                }

                productionDatabase = stagingDatabase;
                stagingDatabase = null;
            }
        }
        private void OnUpdateDatabaseDoWork(object sender, DoWorkEventArgs e)
        {
            lock (updateSyncRoot)
            {
                AutoCompleteWorkData workData = e.Argument as AutoCompleteWorkData;

                // At the beginning of build and database population, assume
                // that at any point if we return earlier, the operation is
                // considered a failure, and no further database promotion
                // should be done.
                e.Result = false;

                ProtoCore.Core core = CompileCodeSnapshot(workData);
                if (null != core)
                {
                    stagingDatabase = new SymbolDatabaseProxy(core, scopeIdentifiers);
                    e.Result = true;
                }
            }
        }