Advantage Developer Zone

 
 
 

Using Replication to Add Value to Your Application

Sunday, December 18, 2005

The Advantage R&D team has created a powerful new tool that allows you to keep data in remote Advantage server locations up-to-date, Advantage Replication. This tool is no longer based on the Extended Systems OneBridge product. Advantage Replication can enable applications to add features such as multi-site inventory visibility and management, and multi-office practice management through account and appointment visibility. Replication can oftentimes be added without changes to the application or data structures. If AutoInc fields are used as a primary key and two-way replication is done, some additional steps would be necessary in the data dictionary setup and tables structures such as a site specific field and default field values and/or trigger to populate it.

For example, suppose that your software is used to manage inventory at two department stores. You could use replication to allow each store to have an up-to-date indication of the other store’s inventory. In the case of practice management software, Advantage Replication could enable visibility of appointments at other offices.

To use replication, it is necessary to define the replication rules in the source data dictionary to which your application connects. The replication information needs to be defined only in the source data dictionary. It is not necessary to define any replication information at the target database unless you want to replicate changes to that database back to the source or to another location.

At the source data dictionary, define a publication and a subscription. The simplest way to do this is to use Advantage Data Architect. Open a data dictionary, right-click on PUBLICATIONS in the connection repository and choose Create. A wizard will take you through the steps of creating the publication. You choose how to identify rows at the target (either via primary key or by all searchable columns) and you choose which tables (articles) to include in the publication.



Once you have created a publication, create a subscription. Right-click on SUBSCRIPTIONS in the connection repository and choose Create. Specify the subscription name, the publication to replicate, the target database with username/password, and the path for the replication queue. When specifying the target database, include the full connection path with the target data dictionary name. You can specify it the same as you would any connection path in a client application (e.g., UNC or IP address and port). The username and password are used by Advantage Database Server to connect to the target data dictionary. The specified username should have the necessary privileges to make updates to the replicated tables.



At this point, you should be able to edit one of the source tables that you selected for replication, and the changes will be replicated.

Note: A table is marked for replication only when it is first opened, so if a table was open when the subscription was created, it will not be replicated until all instances of the table are closed.