How to Configure the Synchronization of a Table
Introduction
The configuration of the tables to be synchronized is done in the Synchronized Table, available using the System Administrator role.
Configuration Options
- Table: The table to be synchronized
- Channel: The synchronization channel that will to synchronize this table. Note that if the contents of the table reference rows from other synchronized tables, they will have to share the same channel.
- Synchronize Insertions/Updates/Deletions: This flags allow to specify if the insertions/updates/deletions on this table be synchronized. For instance, the C_IMPORT_ENTRY table only synchronizes insertions.
- Synchronization Direction: Specifies the direction of the synchronization. The available options are Main Server to Store Server, Store Server to Main Server and Bidirectional.
- Router: The router that will be used to decide which servers should be notified of changes in this table. There are two predefined routers:
- BaseClientFilteredRouter: All the store servers that belong to the same client as the modified row will receive the change.
- DefaultOrganizationBasedRouter: Only the store servers that have access to the organization of the modified record will receive the change.
- Automatically Clear External References on Sync. If this flag is checked, an extra effort will be made to prevent synchronization error in case some columns of a synchronize table reference other tables that are not synchronized, and whose records may not be present in the store servers.
Defining columns that should not be synchronized
The columns of a synchronized table can be configured to be excluded from synchronization. This is done in the Excluded Columns subtab of the Synchronized Table window.
If a column is excluded from synchronization, then:
- When an insert is synchronized, then that column will take the default value defined in the database. Beware of excluding from synchronization mandatory columns that do not have a default value.
- When an update is synchronized, the previous value of the excluded column will remain the same after the update, regardless of whether it was modified in the source server.
It is possible to configure a column of a synchronized table to exclude it only if some conditions are met. There are three fields to set up this configuration:
- Exclusion direction: To specify whether the column should be excluded in the synchs from Central to Store, from Store to Central or in both directions. This configuration is only available is the table is synchronized bidirectionally.
- Exclude on insert: To specify whether the column should be excluded from insertions. This configuration is only available is insertions are synched on the synchronized table
- Exclude on update: To specify whether the column should be excluded from updates. This configuration is only available is updates are synched on the synchronized table
For instance, suppose that in a table that is synchronized bidirectionally a column must be excluded only in the updates that will be synchronized from the Store to the Central Server. The configuration of that column will be:
- Exclusion direction: Store to Central Server
- Exclude on insert: False/Unchecked
- Exclude on update: True/Checked