Kbase 34310: What is the Data Replication Toolkit sample source code.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Solution ID: P4310
GOAL:
What is the Data Replication Toolkit sample source code.
FIX:
The following is a general description of the sample source code that is a part of the Data Replication Toolkit.
This toolkit is designed to be a starting point for adding Data Replication to an application.
Progress Technical Support is providing this code as an example only and it needs to be developed and tested on your own system so that it will perform as you expect.
To implement Data Replication in an application, copy the sample source code to your application source directory structure and make any modifications necessary.
In version 8 the Data Replication Toolkit is located in DLC/src/prodict/rplctn; it was removed from the early version 9 products, and it was reintroduced in 9.1D, located in DLC/src/samples/rplctn.
Data Replication Administration
rplctn/stdobj/rpladmn.w --> Replication Administration Screen
(calls admin/f-admin.w)
rplctn/admin/f-admin.w --> SmartFrame which contains buttons to call the various Data Replication Administration screens
Connect Admin DB: rplctn/stdobj/dbconn.p
Disconnect Admin DB: rplctn/stdobj/discon.p
System Configuration: rplctn/admin/d-syscfg.w
Remote System Connection Parameters: rplctn/admin/d-systms.w
rplctn/admin/b-systms.w
rplctn/admin/v-systms.w
Collision Resolution: rplctn/admin/d-collis.w
rplctn/admin/f-collis.w
Current Records to Replicate: rplctn/admin/d-chngs.w
Replication Log: rplctn/admin/d-log.w
rplctn/admin/b-replog.w
Deletion Resolution: rplctn/admin/b-tables.w --> Smart Browser listing all table names with the associated Replication procedure name & Collision procedure name (if any)
Data Replication Standard Objects
stdobj/c-chng.p - Trigger Procedure for Create of replicate-chng
stdobj/dbconn.p - Database connection procedure
stdobj/discon.p - Database disconnect procedure
stdobj/f-dbinfo.w - Displays physical name of connected database
stdobj/f-rplctn.w - Frame used to run Data Replication
stdobj/repdef.i - Variable definitions for the Replication databases
stdobj/replic.i - Include file to be used by all replication program
stdobj/reptrgr.i - Standard trigger for replication
stdobj/transrep.p - Perform Data Replication by transaction id
Template
template/gentrgr.p - Program used to generate database replication triggers
template/repltmpl.p - Template used to create table replication programs
Tables (df files are in template/)
replicate-chng - All record changes that need to be replicated
replicate-coll - All collisions that have occurred between Local & Remote DBs
replicate-log - History File of all Replication Sessions
replicate-mstr - Remote Systems Master File
system-config - System Configuration File
Steps to Implement Data Replication
1. Load new replication files into both databases (local & remote) using the df files found in template/.
2. Define the system id in the system-config file for each database which is using replication. You can use the "System Configuration" button found on the Replication Administration Screen.
3. Define the remote system id in the replicate-mstr file. You can use the "Remote System Connection Parameters" button found on the Replication Administration Screen.
4. Create a replication procedure for each table that should be replicated. Each replication procedure can be created from template/repltmpl.p. Enter the name of each replication procedure (.p) into the corresponding table properties screen in the data dictionary.
5. Add replication triggers to each file that should be replicated. Use template/gentrgr.p to automatically generate replication triggers.
6. Change the &GLOBAL-DEFINE definitions in stdobj/repdef.i on each system to reflect the appropriate database alias names.
7. The sample code that is included in the product does not i.nclude programs which will resolve collisions that could happen during data replication. The code which will detect collisions can be found in admin/d-collis.w. You can use this as a starting point to resolve the collisions, but all collisions need to be resolved based on your business rules..