Collection Contents Previous Next PDF

MobiLink Administration Guide

Synchronization Techniques

Handling deletes


When rows are deleted from the consolidated database, there needs to be a record of the row so it can be removed from any remote databases that have the row.

One technique is to not delete the row. Data that is no longer required can be marked as inactive by changing a status column in the row. In this case, called a logical delete, the download_cursor and download_delete_cursor can refer to the status of the row in the WHERE clause. This technique is used in the ULEmpCust table in the CustDB sample application, in which the action column holds a D for Delete. The scripts use this value to delete the record from the remote database, and delete the record from the consolidated database at the end of the synchronization. CustDB also uses this technique for the ULOrder table, and the Contact sample uses the technique on the Customer, Contact, and Product tables.

A second technique is to have a shadow table that stores the primary key values of deleted rows. When a row is deleted, a trigger can populate the shadow table. The download_delete_cursor can use the shadow table to remove rows from remote databases. The shadow table only needs to have the primary key columns from the real table.

For more information, see Writing download_delete_cursor scripts.


Collection Contents Previous Next PDF