Consultor Eletrônico



Kbase 16732: Data Replication Toolkit - sample source code
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/05/1998
Data Replication Toolkit - sample source code

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.

The Data Replication Toolkit is located in DLC/src/prodict/rplctn.

Data Replication Administration

prodict/rplctn/stdobj/rpladmn.w --> Replication Administration Screen
(calls admin/f-admin.w)
prodict/rplctn/admin/f-admin.w --> SmartFrame which contains buttons
to call the various Data Replication Administration screens

Connect Admin DB: prodict/rplctn/stdobj/dbconn.p
Disconnect Admin DB: prodict/rplctn/stdobj/discon.p
System Configuration: prodict/rplctn/admin/d-syscfg.w
Remote System Connnection Parameters: prodict/rplctn/admin/d-systms.w
prodict/rplctn/admin/b-systms.w
prodict/rplctn/admin/v-systms.w
Collision Resolution: prodict/rplctn/admin/d-collis.w
prodict/rplctn/admin/f-collis.w
Current Records to Replicate: prodict/rplctn/admin/d-chngs.w
Replication Log: prodict/rplctn/admin/d-log.w
prodict/rplctn/admin/b-replog.w
Deletion Resolution: prodict/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 occured 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
include 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.

Progress Software Technical Support Note # 16732