4D v14.3

INTEGRATE MIRROR LOG FILE

Home

 
4D v14.3
INTEGRATE MIRROR LOG FILE

INTEGRATE MIRROR LOG FILE 


 

INTEGRATE MIRROR LOG FILE ( pathName {; operationNum} ) 
Parameter Type   Description
pathName  Text in Name or pathname of the log file to be integrated
operationNum  Real variable in Number of operation where integration begins
in Number of last operation integrated

The INTEGRATE MIRROR LOG FILE integrates the log file designated by pathName into a 4D Server database, starting with the operationNum operation (optional). The command accepts to integrate any log file into the database, even if it does not correspond to the the data file. This command is specifically intended for use in the context of a mirror database. 

Note: Starting with 4D v14, it is possible to use a log file as part of a "mirror" database: the "Use Log File" option can now be checked in the Database Settings of a 4D Server used as a logical mirror, thus allowing the implementation of a series of cascading mirror servers.

Unlike the existing INTEGRATE LOG FILE command, at the end of its execution INTEGRATE MIRROR LOG FILE does not replace the current log file with the integrated one: the current log file of the database continues to be used. Accordingly, any changes made during integration are saved in the current log file.

In pathName, you pass an absolute or relative path to the database folder. If you pass an empty string in this parameter, a standard open file dialog box appears so that you can specify the file to be integrated. If this dialog box is canceled, no file is integrated and the OK system variable is set to 0.

By default, when you omit the operationNum parameter, the command integrates all the operations of the log file.
If you pass a value in the operationNum parameter, integration begins at the value specified. After integration, if you passed a variable in operationNum , this parameter contains the number of the last operation integrated. This allows you to follow on with subsequent log file integrations by directly passing the value returned in operationNum during the next call to INTEGRATE MIRROR LOG FILE.

The following diagram (pseudocode) details the integration process depending on the various cases. In the log file to be integrated, X is the number of the first operation and Y is the number of the last one:

Case of
    : (operationNum < X-1)
                        --> Error 1260 (Selected log file is too recent)
    : (operationNum >= X-1) and (operationNum <= Y)
                        --> Start integration
        Case of
            : (Type of operation = "Addition")
                If (Record exists)
                        --> Do nothing
                Else
                        --> Add record
                End if
            : (Type of operation = "Modification")
                If (Record exists)
                        --> Edit record
                Else
                        --> Do nothing
                End if
            : (Type of operation = "Deletion")
                If (Record exists)
                        --> Delete record
                Else
                        --> Do nothing
                End if
            End case
        Else// operationNum > Y
                        --> Error 1261 (Selected log file is too old for database)
End case

Note that integration will stop at the first error encountered. In this case, if you want to continue with the integration you will need to use the MSC.

If the integration is carried out correctly, the system variable OK is set to 1; otherwise, it is set to 0.

 
PROPERTIES 

Product: 4D
Theme: Backup
Number: 1312

The OK variable is changed by the commandThis command modifies the Error system variableDifferent in remote mode

 
HISTORY 

New
Created: 4D v14

 
SEE ALSO 

INTEGRATE LOG FILE

 
ARTICLE USAGE

4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)