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,or 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
how authentication takes place during synchronization (optional)
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 SQL Central or you can use system procedures.
During synchronization, the MobiLink server reads the scripts if they are not already loaded, then 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, and very few for others.
You can write scripts in SQL, Java, or .NET. This information applies to all kinds of scripts, but focuses on how to write synchronization scripts in SQL.