Contents Index Development tips Snapshot synchronization

MobiLink Synchronization User's Guide
  Synchronization Techniques

Timestamp-based synchronization


The timestamp method is the most useful general technique for efficient synchronization. The technique involves tracking the last time that each user synchronized, and using this information to control the rows downloaded to each remote database.

MobiLink maintains a timestamp value indicating when each MobiLink user last downloaded data. This value is called the last download timestamp. The last download timestamp is provided as a parameter to many events, and can be used in synchronization scripts.

To implement timestamp-based synchronization for a table

  1. At the consolidated database, add a column that holds the most recent time the row was modified. This column is not needed at remote databases. The column is typically declared as follows:

    DBMS last modified column
    Adaptive Server Anywhere timestamp DEFAULT timestamp
    Adaptive Server Enterprise datetime
    Microsoft SQL Server datetime
    Oracle date
    IBM DB2 timestamp
  2. In scripts for the download_cursor and download_delete_cursor events, compare the first parameter to the value in the timestamp column.

Example 

The following table declaration and scripts implement timestamp-based synchronization on the Customer table in the Contact sample:

For more information, see Synchronization logic source code, and Synchronizing contacts in the Contact sample.


Contents Index Development tips Snapshot synchronization