ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Journaled replication: Directories for creating the files needed for replication and logging.
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Creates the description file of a subscriber replica. The subscriber replica file extension is "rpl".
This function can be used with the logged replication and/or with the universal replication
Attention: When creating a subscriber replica, you must:
AndroidAndroid Widget iPhone/iPad Only universal replication is available.
Example
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxHFSQL ClassicHyper File 5.5
// Create the master replica file in the C:\RPL\France directory
// while specifying a file name
HCreateMasterReplica("C:\RPL\France\ReplicaFrance.rpm")
// Create the subscriber replica
HCreateSubscriberReplica("C:\RPL\France\", "C:\RPL\USA", 1)
Syntax

Universal replication Hide the details

<Result> = HCreateSubscriberReplica(<Master replica directory> , <Subscriber replica directory> , <Identifier> , <Identifier size range> , <List of tables to replicate> [, <Automatic modification>])
<Result>: Integer
  • Identifier of the subscriber replica that was created,
  • 0 if no subscriber replica was created.
<Master replica directory>: Character string
Directory where the master replica description file ("rpm" file) was created (HCreateMasterReplica). This directory can be a network directory or a UNC path.
If this parameter corresponds to an empty string (""), the description file will be searched for in the current directory of HFSQL data files (defined in the data model editor or through programming).
Warning: This directory must be accessible when HCreateSubscriberReplicais executed.
<Subscriber replica directory>: Character string
Directory where the subscriber replica description file must be created. This file is named Replica_<Identifier>.rpl.
If this parameter corresponds to an empty string (""), the description file will be created in the current HFSQL data file directory (defined in the data model editor or programmatically).
<Identifier>: Integer or character string
Subscriber replica identifier. This identifier will be used by HCreateMovableReplica.
A WLanguage error occurs if the specified identifier already exists.
<Identifier size range>: Integer
This parameter is ignored.
<List of tables to replicate>: Character string
This list has the following format:
<TableName>[+TAB+<NameDateItem>]
[+<CR>+<TableName>[+TAB+<NameDateItem>]]...
Caution: Table order is important. The order of the tables is the order of the dependencies for the tables.
If the records of file 1 are linked to the records of file 2 and if the record must be found in file 2 in order for the addition in file 1 to comply with the integrity rules, then file 1 must be positioned first in the list.
For example, for the "Customer", "Orders" and "Order line" files (that are linked by links whose cardinalities are (0,n) - (1,1)), the "Customer" file must be positioned first (a customer must exist to add an order), then the "Orders" file (an order must exist to add an order line) and finally the "Order line" file.
The name of Date item is mandatory for the databases not in HFSQL format. This item must correspond to an item of the data file updated during an addition or during a modification. This operation must be performed by the application.
<Automatic modification>: Boolean
  • True to take into account the automatic data modification. In this case:
    • Changes in the structure of the master database will be carried over to the subscriber database.
    • The new items will be taken into account by the replication.
  • False (default value). The automatic data modification performed on the master database is not carried over to the subscriber database.
Caution:
  • For existing replications, it is necessary to recreate a replication (as well as the subscribers) to implement this mechanism.
  • This mechanism does not work if a unique key is added or deleted.
  • This parameter is only available for replication between HFSQL databases (Classic or Client/Server).
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxHFSQL Classic

Logged replication (between HFSQL databases) Hide the details

<Result> = HCreateSubscriberReplica(<Master replica directory> , <Subscriber replica directory> [, <Identifier> [, <Identifier size range>]])
<Result>: Integer
  • Identifier of the subscriber replica that was created,
  • 0 if no subscriber replica was created.
<Master replica directory>: Character string
Directory where the master replica description file ("rpm" file) was created (HCreateMasterReplica). This directory can be a network directory or a UNC path.
If this parameter corresponds to an empty string (""), the description file will be searched for in the current directory of HFSQL data files (defined in the data model editor or through programming).
Warning: this directory must be accessible when HCreateSubscriberReplicais executed.
<Subscriber replica directory>: Character string
Directory where the subscriber replica description file must be created. This file is named Replica_<Identifier>.rpl.
If this parameter corresponds to an empty string (""), the description file will be created in the current HFSQL data file directory (defined in the data model editor or programmatically).
<Identifier>: Optional integer or character string
Subscriber replica identifier. This identifier will be used by HCreateMovableReplica.
If this parameter corresponds to an empty string (""), an identifier is automatically returned by the function. A WLanguage error occurs if the specified identifier already exists.
<Identifier size range>: Optional integer
Size of the range of numbers reserved for the automatic identifiers for this replica. These identifiers will be used for all the new records created by this replica.
  • If this parameter is not specified, the size of the range of reserved identifiers is set to 1 billion.
  • If this parameter is set to 0, no range is reserved for the automatic identifiers.
Remarks
WINDEVWEBDEV - Server codeUser code (UMC)AjaxHFSQL ClassicHyper File 5.5

Journaled replication: Directories for creating the files needed for replication and logging.

Log-based replication is closely linked to the log process. The log process is automatically enabled when the 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 programmatically.
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 programmatically.
Default valueWhere to configure it in the data model editor?How to change the default value through programming?
Data file directoryExecutable directory.
  • For all data files in the application: "Detail" tab of the analysis description
  • For each data file: "Info" tab in the data file description.
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 only the directory of one of the data files, use the HChangeDir function.
Replication file directoryRPL subdirectory of the default directory of the data files."Log\Replica" tab of the analysis description.Specify the desired directory in HCreateMasterReplica and HCreateSubscriberReplica.
Log file directoryJNL subdirectory of the default directory of data files.
  • For all application data files: "Log\Replica" tab in the analysis description.
  • For each data file: "Miscellaneous" tab in the data file description.
To modify the directory of log files, use HChangeLogDir.
This function is used to:
  • change the directory of the Log file (JNL file)
  • change the directory of the JNL file and logging files (JournalIdentification and JournalOperation files).

Please note To manage log replication in an application, the log operations table (JournalOperation.fic file) must be identical for all replicated data files in the same analysis.
Business / UI classification: Business Logic
Component: wd300rpl.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/06/2024

Send a report | Local help