cancel
Showing results for 
Search instead for 
Did you mean: 

Mobilink > Timestamps related to the sync process

0 Kudos
753

I've read Implementing timestamp-based downloads and its subsections multiple times and it has only confused me further:

Why is there a last_modified timestamp in each table in the consolidated DB, but NOT in the remote DBs? As per The synchronization process

By default, the MobiLink client automatically keeps track of which rows in the remote database have been inserted, updated, or deleted since the last successful synchronization. Once the connection is established, the MobiLink client uploads a list of all these changes to the MobiLink server.

If one can keep track of which rows have been synced, and which haven't, WITHOUT the last_modified column, why is it required in each table in the consolidated DB?

Now, as-per How download timestamps are generated and used...

The last download time is stored on the remote database. This is the appropriate place because only the remote database knows if the download has been successfully applied. For SQL Anywhere remotes, the last download time is stored per subscription and can be viewed using the SYSSYNC system view.

... whereas as per Implementing timestamp-based downloads...

To implement timestamp-based synchronization for a table, at the consolidated database, add a last_modified column that holds the most recent time the row was modified.

How many timestamps are we talking about here? Where is each one of them stored? And why does every table in the remote-db not have a last_modified column?

Vlad
Product and Topic Expert
Product and Topic Expert
0 Kudos

When the sync completes, your remote DB knows this timestamp already. It is not a timestamp (instant) value per table/record/whatever. It is either everything, or nothing.

When you start another sync, this timestamp value is sent to Mobilink, where it just compares the "last successful sync timestamp" with all tables & records that you want to synchronize again. Something like:

SELECT * FROM yourTable WHERE last_modified >= ?

This SQL will return you new records, that will be sent to Remote DB. And your timestamp will be updated eventually.

Something like that...

Accepted Solutions (0)

Answers (0)