Chapter 3 Working with Dynamo Web Sites


Scheduling actions

With PowerDynamo you can schedule a script or template to be executed periodically.

Scheduling script and template execution provides an alternative way of quickly providing to users the results of queries that take a long time to run. It allows the results to be kept up to date, while allowing quick and efficient access from Web clients.

The output of a scheduled script is stored in the Web site and available to users.

Note  

For scheduling to take effect:
For scheduling to take effect, the Load at startup and Enable scheduling options must both be selected for the mapping representing this site. These options are visible after clicking the Browse button in the mapping property window.

If the Personal Web server or the Dynamo application server you are using is already running, it must be restarted in order for scheduling to take effect.

Steps To schedule a script:

  1. Use Sybase Central to locate the script or template you want to schedule.

  2. Right-click the script or template and select Schedule from the menu. This will start the schedule wizard.

  3. Select the appropriate time interval from the pull down menu in the wizard.

  4. The second screen of the wizard allows you to enter a time interval, at which the document is to be generated. If you do not enter the time interval exactly as specified in the following table default values will be used.

    You must use a 24 hour clock to enter time intervals. Time interval values are not case sensitive.

    Time Interval (Window 1)

    Time Interval Format (Window 2)

    Example

    Default

    Hourly

    MM

    30

    00

    Daily

    HH:MM

    21:30

    00:00

    Weekly

    Day HH:MM

    Saturday 21:30

    Sunday 00:00

    Monthly

    DD HH:MM

    02 12:00

    01 00:00

    Yearly

    Month DD HH:MM

    June 15 18:00

    January 00 00:00


File replaced with its output

The file containing the script or template is modified to instead contain the output of the document. In this manner, you can change a script or template from on-demand processing to scheduled processing without changing the URL.

Original file saved to a different location

The contents of the original script or template are saved in a file with the same name but a changed extension. The extension for script source is sss, while the extension for template source is sts. The source is saved in the same directory as the original script.

The contents of the ssc or stm file are altered to indicate that the contents are pre-generated from a scheduled script or template.

The schedule.ssc document in the system directory is altered to add a call to site.Schedule() . This call adds the scheduled document to the list of scheduled documents. The schedule.ssc document is imported by autoexec.ssc.

Note  

Scheduling with ISAPI or NSAPI servers
Scheduling begins when the first request for a script has been made to the Web server. ISAPI and NSAPI Web servers do not load the Dynamo plug-in until it is needed - such as when the first scheduled script is requested.

Removing a scheduled action

You can unschedule previously scheduled documents. This replaces the pre-generated document with the original script or template. The script is then processed on demand, rather than according to a schedule.

Steps To remove a scheduled action:

  1. Use Sybase Central to locate the script or template you want to unschedule.

  2. Right-click the script or template and select Unschedule from the menu.


The script contents are restored to the original document name, and the source document that was produced when the document was scheduled is deleted. Also, the site.Schedule() line is removed from the schedule.ssc document.

Note  

Scheduled actions and SQL Remote
Adaptive Server Anywhere users employing SQL Remote should ensure that the Personal Web Server at each remote database is configured so that scheduled actions are not executed. If scheduled actions take place at both consolidated and remote databases, replication errors may occur.

 


Copyright © 1999 Sybase, Inc. All rights reserved.