You control the synchronization process by writing synchronization scripts and storing or referencing them in MobiLink system tables in the consolidated database. You can write scripts in SQL, Java, or .NET.
MobiLink synchronization logic is specified with synchronization scripts. Scripts define:
how data that is uploaded from the remote database should be applied to the consolidated database
what data should be downloaded from the consolidated database
Scripts can be individual statements or stored procedure calls. They are stored or referenced in your consolidated database. To add scripts to the consolidated database, you can use Sybase Central or you can use system procedures.
During synchronization, the MobiLink server reads the scripts and executes them against the consolidated database.
The synchronization process has multiple steps. A unique event 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 server executes each script when its associated event occurs. If you do not define a script for a particular event, the MobiLink 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 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 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 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.
Simple synchronization script