PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • The logged replication by network
  • What is it?
  • The possible actions
  • How to replicate by network and by programming
  • Constraints and tips
  • The logged replication via movable media
  • What is it?
  • The possible actions
  • Constraints and tips
  • By programming
  • WLanguage functions for managing the logged replication
  • Functions for managing the logged replication
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Logged replication: Programming the logged replication in WLanguage
HFSQLAvailable only with this kind of connection
Overview
Several WLangage functions allow you to include the logged replication in your application and to customize it. In this case, no external tool is required: the replication of data between your databases is managed by programming.
Two modes of logged replication can be implemented by programming:
  • the logged replication by network (case of a laptop computer that connects to the company network on a regular basis).
  • the logged replication via movable media (case of remote sites that do not connect via a network).
Note: From version 19, HFSQL is the new name of HyperFileSQL.
The logged replication by network

What is it?

The logged replication by network corresponds to the operation performed to synchronize two databases accessible on the same network.
The most common example is a salesman who regularly connects to the company network via his laptop computer. The replication allows him to update the company database with the new orders entered during the week.
During this operation, the company database and the laptop database are accessible via network. The replication can be performed via network.

The possible actions

The logged replication by network is used to perform:
  • a unidirectional replication:
    • from the master computer to the subscriber computers.
    • from the subscriber computers to the master computer.
  • a bidirectional replication, which means from the master computer to the subscriber computer (and conversely).

How to replicate by network and by programming

The following operations must be performed:
  1. Creating the master replica on the master computer (HCreateMasterReplica).
  2. Creating the subscriber replica on the subscriber computer (HCreateSubscriberReplica). The subscriber computer must have read/write access to the disk where the master application is installed (directory of data files).
  3. Using the master and subscriber applications.
  4. Synchronizing (HSynchronizeReplica):
    • from the subscriber computer to the master computer (rplToMaster constant constant): the subscriber computer must have read/write rights on the disk where the master application is installed.
    • from the master computer to the subscriber computer (rplToSubscriber constant): the master computer must have read/write rights on the disk where the subscriber application is installed.
    • bidirectional (rplBidirectional constant): the master computer must have read/write rights on the disk where the subscriber application is installed and the subscriber computer must have read/write rights on the disk where the master application is installed.
Caution: This paragraph assumes that the necessary operations have been performed in the application analysis before installing the application on the different computers. See Logged replication: Modifying the analysis for more details.

Constraints and tips

  • When creating the subscriber replica, the computer where the subscriber replica is installed must have read/write access onto the directory where the master replica is installed.
  • To perform the logged replication, the path of the data files to replicate can be identified by:
    • a drive letter. In this case, the two computers involved in the replication must use the same drive letter. For example, if the replication is started from the subscriber computer:
      • on the master computer, the directory of the data files is found on X,
      • on the subscriber computer, the letter X must be associated with the drive containing the data files of the master computer.
    • UNC paths
    • relative paths.
  • To manage the logged replication in an application, the table of log operations (JournalOpération.fic file) must be identical for all the files in replication in the same analysis.
  • The files required by the replication (*.RPM and *.RPL files) should be saved in a RPL sub-directory of the application data files.
  • If the log process is used for the replication only, the log files can be located in the directory of application (or in a sub-directory).
  • If the log process is used to keep a backup of the files, these files should be located on a disk other than the one used for the data files (for better security).
The logged replication via movable media

What is it?

The logged replication via movable media corresponds to the operation performed to synchronize two databases not connected to each other.
The most common example corresponds to two sites that are geographically distant: a site in Montpellier and a site in Paris for example. The databases are updated on a regular basis via different media: transfer by FTP, diskette or CD ROM, ...

The possible actions

The logged replication via movable media allows you to perform a unidirectional replication:
  • from the master computer to the subscriber computers
  • from the subscriber computers to the master computer

Constraints and tips

  • To manage the logged replication in an application, the table of log operations (JournalOpération.fic file) must be identical for all the files in replication in the same analysis.
  • The files required by the logged replication (*.RPM and *.RPL files) should be saved in a RPL sub-directory of application data files.
  • If the log process is used for the replication only, the log files can be located in the directory of application (or in a sub-directory).
  • If the log process is used to keep a backup of the files, these files should be located on a disk other than the one used for the data files (for better security).

By programming

The following operations must be performed in order to synchronize the master computer with the subscriber computer:
  1. Creating:
    • the master replica on the master computer (HCreateMasterReplica).
    • the subscriber replica on the subscriber computer (HCreateSubscriberReplica). Each subscriber computer must be associated with a specific identifier. This identifier will be used during the synchronization.
      These two replicas can be created in the same directory (not recommended).
  2. Installing the file of subscriber replica on the subscriber computer. This file can be installed:
    • in the replication directory specified in the analysis (\RPL sub-directory of data files by default).
    • in another directory. In this case, the subscriber application must use HChangeRplDir to specify the location where the file of subscriber replica will be sought. Indeed, when the subscriber data file is opened, the RPL file is read in order to define the range of automatic identifiers used by the data file.
  3. Using the master and subscriber applications.
  4. On the subscriber computer, creating the movable replica (HCreateMoveableReplica). A file with a WDZ extension is created by default. This file must be transmitted to the master computer.
  5. Synchronization on the master computer (HSynchronizeReplica). To perform this synchronization, you must specify:
    • the name and path of the movable replica on the master computer
    • the identifier of the subscriber replica (specified when creating the subscriber replica).
Caution: This paragraph assumes that the necessary operations have been performed in the application analysis before installing the application on the different computers. See Replication with WINDEV for more details.
WLanguage functions for managing the logged replication

Functions for managing the logged replication

The following WLangage functions are used to manage the logged replication:
HChangeRplDirModifies the location for the description of subscriber replica (RPL file). This function must be used on the subscriber computer.
HCreateSubscriberReplicaCreates the description file of a subscriber replica (*.RPL file).
HCreateMasterReplicaCreates the description file of a master replica (*.RPM file).
HCreateMoveableReplicaCreates a file that can be used to replicate the data from the current database to a remote database (for sending via email or diskette for example).
HSetReplicationTemporarily disables (or re-enables) the replication. The replication is automatically managed by default.
HInitSubscriberInitializes the range of automatic identifiers for the description file of subscriber replica (".RPL" extension).
HSynchronizeReplicaSynchronizes a master replica and a subscriber replica.
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment