Switch to: V9V8V7V6V5

Using Event Scheduler

Valentina Server 3.0 introduces new major feature Event Scheduler.

You can create some event, which in fact is any Valentina SQL command and schedule it to be executed

  • once at some time;
  • periodically with some interval starting at time

You can read the details of SQL commands to manage events here.

Scheduler Thread Enabling

The ini file of Valentina Server has a line that controls if Valentina Server will run Scheduler thread on the start:

ScheduleEnable=1;                     1 - Run scheduler.

On default after installation it is 1, so you can go ahead and start create new events. In case you are not going to use Scheduler, you can disable it to avoid creation of thread (although it will not eat CPU time).

Events and Master Database

Please pay attention that Valentina Server stores EVENTS in the master database, but not in the database files itself. Each event although is associated with some database managed by Valentina Server. This fact you can see in the command CREATE EVENT, it requires specify name of database for a new event.

It is important to keep in mind, that EVENT SQL commands should be directed to Master Database of Valentina Server. For this you must at first make it active with help of USE DATABASE command.

Example:

// We must activate master DATABASE first of ALL.
USE master;
 
CREATE EVENT backup_db1_24 FOR db1
    ON SCHEDULE EVERY 1 DAY STARTS TIMESTAMP '2007-01-25 23:59:59'
    DO 
       BACKUP DATABASE

Browsing Existed Events

To check what events Valentina Server has, you can use SQL command SHOW EVENTS.

SHOW EVENTS FROM db_name 

Enabling/Disabling Events

You can enable/disable some event using SQL command ALTER EVENT .

USE master;
 
ALTER EVENT myevent
    DISABLE;

Events and Valentina Studio

Valentina Studio offer managing of EVENTS with help of easy GUI. You can browse events and their properties, enable/disbale events by mouse click. Create/Drop events with help of SQL Editor or Dialogs.