PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Modifying the type of lock for a data file
  • Effect of lock mode
  • Lock failure
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
Locks a data file and restricts the access to this data file for all other sites or applications. Then, the data file can be unlocked by <Source>.UnlockFile.
Several cases may occur after the call to <Source>.LockFile:
  • A file record is already locked by another application: the lock cannot be performed.
  • The data file is already locked by another application: the lock cannot be performed.
HErrorLock returns True if a lock problem occurs.
AndroidAndroid Widget Java This function can be used with HFSQL Client/Server data files.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 19 and later
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
Java This function is now available for Java applications.
New in version 19
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
Java This function is now available for Java applications.
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
Java This function is now available for Java applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Blocage du fichier de données CLIENT
SI Client.BloqueFichier(hBlocageLectureEcriture) = Faux ALORS
SI HErreurBlocage() = Vrai ALORS
Erreur("Opération impossible")
FIN
FIN
// Traitement sur le fichier de données ...
...
// Redonner l'accès au fichier de données
Client.DébloqueFichier()
Syntax
<Result> = <Source>.LockFile([<Lock>])
<Result>: Boolean
  • True if the lock was performed,
  • False if a problem occurred (the file is already locked for example). HError is used to identify the error.
<Source>: Type corresponding to the specified source
Name of the data file used.
<Lock>: Optional integer constant
Used to define the type of lock performed on the data file:
hLockWrite
(default value)
Lock in write mode: the records found in the data file can be read by another application but cannot be modified by another application. No lock on the data file can be defined by another application.
hLockReadWriteLock in read/write: the records found in the data file cannot be read or modified by another application. No lock on the data file can be defined by another application.
hLockNoNo effect

Hyper File 5.5 <Lock> is ignored.
AndroidAndroid Widget Java The management of locks is performed on the HFSQL Client/Server data files only.
Remarks

Modifying the type of lock for a data file

To modify the type of lock applied to a data file, call <Source>.LockFile and specify the requested type of lock. There is no need to unlock the data file beforehand.

Effect of lock mode

If the data file is in blocking mode hModeMono (see function <Source>.Mode), function <Source>.LockFile has no effect.

Lock failure

If the data file (or one of its records) is already locked, the lock request is retried H.NbRetry times (50 by default).
If the data file cannot be locked after H.NbRetry attempts, HErrorLock returns True.
Component: wd270hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment