Creates the description file of a Master Replica (logged replication or universal replication)
). The extension of the corresponding file is ".RPM".
The description file of a Master Replica contains the list of Subscriber Replicas with their date of last synchronization. This file is empty when it is created. You must call HCreateSubscriberReplica
to initialize this file.
Note: This function is automatically called during the setup phase of the application that manages the replication.
Note: The replication is not available when accessing a database via Remote access
Note: From version 19, HFSQL is the new name of HyperFileSQL.
<Result> = HCreateMasterReplica([<Directory of Master Replica>])
- True if the master replica was created,
- False otherwise (the file already exists in the specified directory for example).
<Directory of Master Replica>: Optional character string (with quotes)
Directory where the description file of Master Replica must be created. This directory must be accessible when using HCreateMasterReplica.
If this parameter:
- is not specified or if it corresponds to an empty string: the MasterReplica.RPM file is created in the directory specified in the analysis (RPL sub-directory of the data files by default). For the universal replication, if this parameter is not specified or if it corresponds to an empty string (""), the file is created in the current directory.
- corresponds to a name of directory (network or UNC directory): the MasterReplica.RPM file is created in the specified directory.
Example: HCreateMasterReplica("C:\Temp") creates the ReplicaMaître.RPM file in the C:\Temp directory.
- has the <Directory>\<FileName>.RPM format: the <FileName>.RPM file is created in the specified directory.
Example: HCreateMasterReplica("C:\Temp\Paris.RPM") creates the Paris.RPM file in the C:\Temp directory.
Logged replication and log process: Directory for file creation
The logged replication is closely linked to the log process. The log process is automatically enabled when the logged replication is implemented in an application.
For all the files used (data files, log files or replication files), the paths of the corresponding physical files can be defined in the data model editor or by programming.
By default, the tree structure of data files is as follows (example for the SalesMgt application):
The following table presents the default value for these different directories and their configuration mode in the data model editor or by programming.
|Default value||Where to configure it in the data model editor?||How to change the default value by programming?|
|Directory of data files||Directory of the executable.|
- For all the data files of the application: "Details" tab of the analysis description
- For each data file: "Info" tab of the description of the data file.
|To modify the default directory for the data files of the application, use HSubstDir.|
When creating the files for the log process and for the replication, the created directories will be relative to this new directory.
Note: To modify the directory for one of the files only, use HChangeDir.
|Directory of the files for replication||RPL sub-directory of the default directory of the data files.||"Log\Replica" tab of the analysis description.||Specify the requested directory in HCreateMasterReplica and HCreateSubscriberReplica.|
|Directory of files for log process||JNL sub-directory of the default directory of data files.|
- For all the data files of the application: "Log\Replica" tab of the analysis description.
- For each data file: "Various" tab of the description of the data file.
|To modify the directory of log files, use HChangeLogDir. |
This function is used to:
- change the directory of Log file (JNL file)
- change the directory of the JNL file and the directory of the files for the log process (JournalIdentification and JournalOpération files).
: To manage the logged replication in an application, the table of the log operations (JournalOpération.fic file) must be identical for all the data files in replication in the same analysis.