ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Managing locks
  • .Security and <Source>.Flush
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
<Source>.Flush (Function)
In french: <Source>.ForceEcriture
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 data file used is stored (lock, current browse, ...).
Remark: Used on a regular basis, this function minimizes the loss of data caused by the unexpected system outage on the computer where the data files are located (power failure for example).
Example
// Add a record in a data file
// (record described through programming)
Customer.LastName = "Clark"
Customer.FirstName = "Vince"
Customer.Address = "Palm lane"
Customer.City = "San Francisco"
Customer.Zip = "94102"
Customer.Country = "USA"
Customer.Add()
// Forces a write operation into Customer file
Customer.Flush()
Syntax
<Source>.Flush()
<Source>: Type corresponding to the specified source
Name of the data file used.
Remarks
Universal Windows 10 AppiPhone/iPadHFSQL ClassicHFSQL Client/Server

Managing locks

During the call to <Source>.Flush, 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: It is not advisable to call 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.

<Source>.Security and <Source>.Flush

<Source>.Security and <Source>.Flush can both be used to force a physical write operation on disk.
However:
  • <Source>.Security is used to force a write operation into the data files used during each write operation. This write operation is automatically performed by the HFSQL engine. The data files used are not closed during this write operation. The speed of the write-to-file operation is slower.
  • <Source>.Flush forces the data file(s) to be written when it is called. The data files used are closed then re-opened during this write operation. The speed of the write-to-file operation is not slowed down.
Component: wd290hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/06/2023

Send a report | Local help