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

SQL Anywhere 12.0.0 » Context-Sensitive Help » MobiLink Plug-in help » Mappings tab

 

Mappings: Table Mappings

The Table Mappings pane contains one row for each table mapping between a table in the consolidated database and a table in the remote database. You can modify, add or delete table mappings.

The values in the columns show the values you chose in the Create Synchronization Model Wizard, or the wizard's defaults if you did not make a choice. You can modify these values on a table-by-table basis by editing this table.

The Table Mappings pane contains the following columns.

Ordinal column   This column has no title. It numbers the gridlines in the table. If you change the sorting of the tables (by clicking column headings), the grid numbers do not change with the reorder. Icons appear in this column if a remote table has been added, marked for delete, or modified.

Status column   This column notifies you if there is an error, warning, or informational message for the table mapping. If an icon appears in this column, select the table mapping, and then open the Status tab in the Details pane to see the content of the message.

Consolidated Table column   This is the table that you are synchronizing in the consolidated database. The name of the table owner is included in parentheses. Only synchronized consolidated tables are displayed. If you no longer want a consolidated table to be synchronized, remove its table mapping by either right-clicking the row in the Table Mappings pane and choosing Delete, or by changing the Mapping Direction to Not Synchronized, and then saving the model.

Look at the Column Mappings tab in the Details pane to check how the consolidated columns are mapped to the remote columns for the selected table mapping.

Mapping Direction column   The direction of synchronization. The direction can be Not Synchronized, Bi-directional, Download to Remote Only, or Upload to Consolidated Only. Choosing Not Synchronized deletes the table mapping.

Remote Table column   This is the remote table to synchronize with the corresponding consolidated table. You can change the remote table by clicking the column and choosing a different table from the list of remote tables.

If no remote table is selected, the table mapping is invalid.

Download Type column   You can view and modify the implementation in the Download Type tab in the Details pane. Your options in this column are:

  • Timestamp   Data is downloaded only if it changed since the last download. When using timestamp-based downloads, each consolidated table must have a timestamp column to track when changes are made to rows. This can be done by adding a column to the consolidated database tables or by creating shadow tables. Shadow tables are created with the same owner as the base table. When you choose Timestamp, the necessary objects are generated for you when you deploy the model. See Timestamp-based downloads.

  • Snapshot   All data in the consolidated table is downloaded in every synchronization, even if it has already been downloaded. See Snapshot synchronization.

  • Custom   Write your own download_cursor and download_delete_cursor scripts instead of having them generated automatically. You can do this on the Events tab. See Writing download_cursor scripts, and Writing download_delete_cursor scripts.

Download Deletes column   If this checkbox is selected, data that is deleted on the consolidated database is deleted on the remote databases.

If you are using timestamp-based synchronization and this column is selected, the deletions on the consolidated database need to be recorded. There are two ways of doing this: using shadow tables (the default), or using logical deletes. Open the Download Deletes tab in the Details pane to view and modify the implementation.

If you are using snapshot downloads and this column is selected, all existing rows in the remote database are deleted before the downloaded rows are added.

This option cannot be selected if the download type is Custom. In that case, you must write your own download_delete_cursor script. You can do this on the Events.

Download Subset column   Your options in this column are:

  • None   Download the same data to each remote database.

  • User   Each synchronization user (also known as a MobiLink user) only downloads rows where the user name matches a column from the same table or a directly joined table. You can view or modify the implementation on the Download Subset tab in the Details pane.

  • Remote   Each remote database only downloads rows where the remote ID matches a column from the same table or a directly joined table. You can view or modify the implementation on the Download Subset tab in the Details pane.

    Note

    It is usually better to partition by user or by authentication parameter than by remote ID, because the remote ID can change if the remote computer is reset or replaced.

  • Custom   Each synchronization only downloads rows when a SQL expression in the download cursor WHERE clause is true. This option is useful when you need multiple joins or particular business logic in your download cursor WHERE clause. You can view or modify this expression on the Download Subset tab in the Details pane.

Download Delete Subset column   Your options in this column are:

  • None   Do not have a download delete subset.

  • Same   Make this subset an exact copy of the download subset.

  • Custom   Create a custom download delete subset.

Conflict Detection column   Your options in this column are:

  • None   Always apply uploaded updates without checking for conflicts. This option results in the best performance.

  • Row-based   A conflict is detected if the row has been updated on both the remote and the consolidated database since the last synchronization.

  • Column-based   A conflict is detected only if the same column has been updated for the row in both the remote and consolidated databases. Otherwise, only the uploaded column updates are applied. If a table has BLOB columns, row-based conflict detection is used instead.

See Detecting conflicts.

Conflict Resolution column   Your options in this column are:

  • Consolidated   First in wins. Uploaded updates are rejected if they conflict.

  • Remote   Last in wins. Uploaded updates are always applied. Only use this option with column-based detection; otherwise, disable conflict detection for the same result with better performance.

  • Timestamp   The newer change wins, using a timestamp column that you maintain. This timestamp column records the last time that the row was changed. It should exist in both the remote and consolidated tables and be included in the synchronization. To work, your remote and consolidated databases must use the same time zone (preferably UTC) and their clocks must be synchronized.

  • Custom   Write your own resolve_conflict scripts instead of having them generated automatically. You can do this on the Events tab.

See Resolving conflicts.