How to Update the Configuration Tables of SymmetricDS
SymmetricDS Configuration tables are populated based on the contents of four tables defined in Openbravo: strsync_custom_router, strsync_synch_channel, strsync_synchronizedtable and strsync_excludedcol.
When a modules that contains source data that belongs to these tables is updated, the SymmetricDS tables need to be updated accordingly. There are two ways of doing this:
- By uninstalling SymmetricDS and installing it again using the ant tasks. This is already supported, but it is inconvenient because a lot of relevant information can be lost (i.e. changes pending to be synchronized).
- By invoking a task that will only make the changes on the affected SymmetricDS Configuration tables, and by reinstalling the SymmetricDS triggers after it.
This wiki document explains how the second approach (an incremental update) has been implemented.
SymmetricDS Configuration Tables
There are four SymmetricDS tables that need to be properly populated for SymmetricDS to be able to install the triggers in the Openbravo tables:
- Sym_channel. Represents the channels the synchronized tables belong to. Populated based on strsync_synch_channel.
- Sym_router. Represents the implementations of the routers that will be used to determine which servers should be notified of each change. Populated based on strsync_custom_router.
- Sym_trigger. Represents a synchronized table. This table along with sym_trigger_router will be used by SymmetricDS to create the triggers. Populated based on strsync_synchronizedtable and strsync_excludedcol.
- Sym_trigger_router. Determines what router should be used for each synchronized tables. Populated based on strsync_synchronizedtable
These are the four tables whose contents need to be updated to take into account the changes done in the modules that contain the configuration of the synchronized tables.
The full list of SymmetricDS configuration tables can be found here.
The update.symmetric.ds.configuration Task
The update.symmetric.ds.configuration task takes the current content from the configuration tables defined in Openbravo and will update the SymmetricDS tables accordingly. After that, the SymmetricDS triggers will be recreated to take into account the updated configuration.
The contents of all the SymmetricDS runtime tables are not lost (i.e. sym_outgoing_batch, that contains the batches pending to be synchronized), as opposed to what would happen in SymmetricDS was reinstalled.