MobiLink Synchronization User's Guide
Writing Synchronization Scripts
MobiLink Synchronization logic consists of scripts, which may be individual statements or stored procedure calls, stored in your consolidated database. During synchronization, the MobiLink synchronization server reads the scripts and executes them against the consolidated database. Scripts provide you with opportunities to perform tasks at various points of time during the synchronization process. You can use Sybase Central to add scripts to the consolidated database or you can use stored procedures.
The synchronization process is composed of multiple steps. A unique event name identifies each step. You control the synchronization process by writing scripts associated with some of these events. You write a script only when some particular action must occur at a particular event. The MobiLink synchronization server executes each script when its associated event occurs. If you do not define a script for a particular event, the MobiLink synchronization server simply proceeds to the next step.
For example, one event is begin_upload_rows. You can write a script and associate it with this event. The MobiLink synchronization server reads this script when it is first needed, and executes it during the upload phase of synchronization. If you write no script, the MobiLink synchronization server proceeds immediately to the next step, which is processing the uploaded rows.
Some scripts, called table scripts, are associated not only with an event, but also with a particular table in the remote database. The MobiLink synchronization server performs some tasks on a table-by-table basis; for example, downloading rows. You can have many scripts associated with the same event, but each with different application tables. Alternatively, you can define many scripts for some application tables, but none for others.
For an overview of events, see The synchronization process.
For a description of every script you can write, see Synchronization Events.
You can write scripts in SQL, Java, or .NET. This chapter applies to all kinds of scripts, but focuses on how to write synchronization scripts in SQL.
For a description and comparison of SQL, Java, and .NET, see Options for writing synchronization logic.
For information about writing scripts in .NET, see Writing Synchronization Scripts in .NET.
For information about writing scripts in Java, see Writing Synchronization Scripts in Java.
For information about how to implement synchronization scripts, see Synchronization Techniques.
A simple synchronization script
Generating scripts automatically