Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » MobiLink - Server Administration » Synchronization Techniques

MobiLink development tips Next Page

Timestamp-based downloads

The timestamp method is the most useful general technique for efficient synchronization. This technique involves tracking the last time that each user synchronized and only downloading rows that have changed since then.

MobiLink maintains a timestamp value indicating when each MobiLink user last downloaded data. This value is called the last download time.

See Using last download times in 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. The column is typically declared as follows:


    last modified column

    SQL Anywhere

    timestamp DEFAULT timestamp

    Adaptive Server Enterprise


    Microsoft SQL Server






  2. In scripts for the download_cursor and download_delete_cursor events, compare the first parameter to the value in the timestamp column.

  3. Example

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

    See Synchronization logic source code and Synchronizing contacts in the Contact sample.

    Using last download times in scripts
    Dealing with daylight savings time