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
  • Managing locks
  • HSecurity and HFlush
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
HFlush (Function)
In french: HForceEcriture
HFSQL ClassicHFSQL Client/ServerAvailable only with these kinds of connection
Forces the operating system of the computer where the data files are found to write data onto the disk. The HFSQL context of the manipulated data file is preserved (blocking, current path, etc.).
Remark: Used regularly, this function minimizes data loss caused by unexpected stoppages of the workstation on which the data files are stored (e.g. power failure).
Java This function is available for HFSQL data files only. It is not available for the data files accessed by JDBC.
Example
// Ajout d'un enregistrement dans un fichier de données
// (enregistrement décrit par programmation)
Client.Nom = "Moulin"
Client.Prenom = "François"
Client.Adresse = "Impasse de la belle"
Client.Ville = "Montpellier"
Client.CodeP = "34000"
Client.Pays = "France"
HAdd(Client)
// Force l'écriture dans le fichier Client
HFlush(Client)
Syntax
HFlush(<Data file>)
<Data file>: Character string
Name of the data file used.
If this name is not specified, HFlush will use the last data file used by the last HFSQL function (function starting with "H").
If this parameter corresponds to "*", HFlush will be applied to all open data files.
Caution: In this case, execution of the function may take a long time..
This parameter can also correspond to the name of a group of files (or custom-folder) defined in the analysis (not available in Android and Android widget).
Remarks
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadUser code (UMC)AjaxHFSQL ClassicHFSQL Client/Server

Managing locks

During the call to HFlush, the data file used is closed and re-opened. If locks were implemented on this data file before it was closed, these locks are automatically restored when it is re-opened. Indeed, when closing a data file, the operating system deletes the locks implemented on this data file.
Remark: We therefore advise against calling this function too often on:
  • data files on which an important number of locks is implemented.
  • data files on which an important number of write operations is implemented.

HSecurity and HFlush

HSecurity and HFlush can both be used to force a physical write operation on disk.
However:
  • HSecurity is used to force a write operation into the data files used during each write operation. The HFSQL engine automatically performs the write operation. The data files are not closed during this write operation. This results in slower write speeds.
  • HFlush forces the data file(s) to be written when it is called. The data files are closed and then re-opened during this write operation. The write operation is not slowed down.
Component: wd300hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help