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
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 Sybase Central or you can use system procedures.
There should be no implicit or explicit commit or rollback in your SQL synchronization scripts or the procedures or triggers that are called from your SQL synchronization scripts. COMMIT or ROLLBACK statements within SQL scripts alter the transactional nature of the synchronization steps. If you use them, MobiLink cannot guarantee the integrity of your data in the event of a failure.
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.
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 section 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 server-side 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
Scripts and the synchronization process
Adding and deleting scripts
Writing scripts to upload rows
Writing scripts to download rows
Writing scripts to handle errors
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0|