4D v16.3INTEGRATE MIRROR LOG FILE |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
INTEGRATE MIRROR LOG FILE
INTEGRATE MIRROR LOG FILE
Preliminary note: This command only works with 4D Server. It can only be executed via the Execute on server command or in a stored procedure. The INTEGRATE MIRROR LOG FILE integrates the log file designated by pathName into a 4D Server database, after the operationNum operation. 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: Since 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 (see the Setting up a logical mirror section in the 4D Server manual). Unlike the existing _o_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. In the operationNum variable, you pass the number of the last operation integrated, so that integration begins at the next operation. After integration, the value of the operationNum variable is updated with the number of the last operation integrated. You must save this variable and then reuse it directly as the operationNum parameter for the next integration operation. This allows you to follow on with subsequent log file integrations using INTEGRATE MIRROR LOG FILE. Pass -2 in the variable to integrate all the operations in the log file. Compatibility note: In versions of 4D prior to v15 R4, the operationNum parameter was optional; however, from now on, if the operationNum parameter is omitted, an error is generated. To restore the original functioning of your former code, you can just pass -2 in the operationNum parameter variable. In mode, you pass the integration mode you want to activate. You can use one of the following constants found in the "Backup and Restore" theme:
Note: In strict mode (default mode), 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. When one of these anomalies occurs in auto-repair mode, the record concerned is automatically "repaired" and the related operation is logged in the errObject parameter. After execution is completed, the errObject parameter lists all the repaired records. It contains a single object array named "operations" built as follows: {"operations": Warning: The auto-repair mode must be used in specific cases since it bypasses 4D's internal data integrity checking features. It can be used, for example, when an intermediary log file has been lost or corrupted and you want to recover as many operations as possible. In any case, you need to pay particular attention to data integrity when using this mode. The actual list of available properties depends on the operation type (i.e.: create record, delete record, modify record, create Blob, etc.). Here are the main properties:
You want to integrate a log file on the mirror server in auto-repair mode: //to be executed on the server If the integration is carried out correctly, the system variable OK is set to 1; otherwise, it is set to 0.
See also
|
PROPERTIES
Product: 4D HISTORY
Created: 4D v14 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||