Example #1
0
 private void PerformDatabaseSeed()
 {
     ExTraceGlobals.CmdletsTracer.TraceDebug <ObjectId>((long)this.GetHashCode(), "UpdateDatabaseCopy: PerformDatabaseSeed: {0}", this.DataObject.Identity);
     using (TaskSeeder taskSeeder = this.ConstructSeeder())
     {
         taskSeeder.SeedDatabase();
     }
 }
Example #2
0
        private void InternalProcessDatabaseMode()
        {
            ExTraceGlobals.CmdletsTracer.TraceFunction <string>((long)this.GetHashCode(), "UpdateDatabaseCopy: enter InternalProcessDatabaseMode: {0}", this.m_dbCopyName);
            if (this.CancelSeed)
            {
                ExTraceGlobals.CmdletsTracer.TraceDebug <string>((long)this.GetHashCode(), "UpdateDatabaseCopy: Attempting to cancel the seed for '{0}'", this.m_dbCopyName);
                using (TaskSeeder taskSeeder = this.ConstructSeeder())
                {
                    taskSeeder.CancelSeed();
                    goto IL_9E;
                }
            }
            if (this.BeginSeed)
            {
                ExTraceGlobals.CmdletsTracer.TraceDebug <string>((long)this.GetHashCode(), "UpdateDatabaseCopy: BeginSeed called for database copy '{0}' to asynchronously start the seed.", this.m_dbCopyName);
                base.WriteVerbose(Strings.SeederAsyncBeginCalled(this.m_dbCopyName));
            }
            this.PerformDatabaseSeed();
IL_9E:
            ExTraceGlobals.CmdletsTracer.TraceFunction <string>((long)this.GetHashCode(), "UpdateDatabaseCopy: leave InternalProcessDatabaseMode: {0}", this.m_dbCopyName);
        }
        internal void SeedDatabase(ReplayConfiguration config)
        {
            ReplayState replayState = config.ReplayState;

            if (config is RemoteReplayConfiguration)
            {
                string targetMachine = config.TargetMachine;
                try
                {
                    string      machineFqdn        = targetMachine;
                    string      destinationLogPath = config.DestinationLogPath;
                    string      destinationEdbPath = config.DestinationEdbPath;
                    TDataObject dataObject         = this.DataObject;
                    AddDatabaseCopyTaskBase <TDataObject> .CheckSeedingPath(machineFqdn, destinationLogPath, destinationEdbPath, dataObject.LogFilePrefix);
                }
                catch (SeedingPathWarningException ex)
                {
                    if (this.m_SeedingPostponedSpecified)
                    {
                        base.WriteWarning(ex.Message);
                    }
                    return;
                }
                catch (SeedingPathErrorException exception)
                {
                    base.WriteError(exception, ErrorCategory.InvalidOperation, this.Identity);
                }
                SystemConfigurationTasksHelper.TryCreateDirectory(this.m_server.Fqdn, config.DestinationLogPath, Database_Directory.GetDomainWidePermissions(), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning));
                using (TaskSeeder taskSeeder = this.ConstructSeeder())
                {
                    taskSeeder.SeedDatabase();
                }
                return;
            }
            throw new NotSupportedException(config.GetType() + " is not supported");
        }