Notification Services—Creating a Vacuum Schedule

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
CSharp-Online.NET:Articles
Database Articles

Notification Services

© 2006 O'Reilly Media, Inc.

Creating a Vacuum Schedule

A vacuum schedule named StockWatchVacuumSchedule is created in the CreateVacuumSchedule( ) method of Example 18-1. The code follows:

private static void CreateVacuumSchedule( )
{
  VacuumSchedule vs = new VacuumSchedule
    (a, "StockWatchVacuumSchedule");
  vs.StartTime = new TimeSpan(0, 0, 0);
  a.VacuumSchedules.Add(vs);
  Console.WriteLine("Added vacuum schedule: " + 
    vs.Name);
}

Vacuuming removes old event and notification data from the application database on a daily schedule. The StartTime property specifies the daily time in Universal Coordinated Time (UTC) for the data removal process to start. Although specifying a vacuum schedule is optional, old data is not removed from the database if a vacuum schedule is not specified.

The NMO classes for managing vacuum schedules are described in Table 18-12.

Table 18-12. NMO classes for managing vacuum schedules

Class Description
VacuumSchedule Represents a data removal schedule.
VacuumScheduleCollection Represents a collection of data removal schedules as VacuumSchedule objects. The

VacuumSchedules property of the Application class returns the data removal schedules for the application.


Previous_Page_.gif Next_Page_.gif


Personal tools