ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL
  • Locks in version 5.5
  • Lock in the later versions
  • Locks when migrating a project to a later version
  • Remarks
  • Case HModePerso(True)
  • Case HModePerso(False)
  • Case HModeSemiPerso()
  • Case HModeAuto
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
Locking data files: correspondence between WINDEV 5.5 and the later versions
HFSQL ClassicHFSQL Client/ServerAvailable only with these kinds of connection
Locks in version 5.5
Three management modes of locks were available in network:
  • HModePerso(True): The lock tests had to be run after each call to a Hyper File function.
  • HModePerso(False): The lock tests should be run after each call to a Hyper File function except for the non-locking read functions.
  • HModeSemiPerso(): The test of the status error of lock was automatically run. If the lock failed, the execution of the program was stopped.
HModeAuto was used in single-user mode.
Remark: No automatic management of locks is available for the Memo or Binary Memo items.
Lock in the later versions
In the versions later than version 5.5, the management of locks is easier yet more powerful:
  • HMode(hModeMulti): management of a multi-user mode (network)
  • HMode(hModeMono): management of a single-user mode.
In a new WINDEV 2024 application, in multi-user mode, the locks are automatically managed by the HFSQL engine. This can be customized by HOnError.
Locks when migrating a project to a later version
When a project is migrated to a version later than version 5.5, some operations are automatically performed to keep the operating mode of WINDEV 5.5 while limiting the code modifications. The table below presents for each lock mode of WINDEV 5.5:
  • the operations automatically performed during the migration
  • the operations that must be performed in special cases.
Remark: A project migrated to version 2024 will keep its own management of locks. The code is migrated in order for this management of locks to operate properly.
Remarks

Case HModePerso(True)

Type of 5.5 lock:
HModePerso(True)
Equivalent code:
HMode(hModeMulti)
HOnError("*", hErrAll, "")
  • The equivalent code is automatically inserted when migrating the project.
  • The code line HOnError("*",hErrAll,"") is inserted into the initialization code of project.
  • If your WINDEV 5.5 code contained several calls to HModePerso(True), the line of code HOnError("*",hErrAll,"") must be copied after each call.

Case HModePerso(False)

Type of 5.5 lock:
HModePerso(False)
Equivalent code:
HMode(hModeMulti)
HOnError("*", hErrAll, "")
  • The equivalent code is automatically inserted when migrating the project.
  • The HOnError("*",hErrAll,"") code is inserted into the initialization code of the project.
  • If your WINDEV 5.5 code contained several calls to HModePerso(False), the line of code HOnError("*",hErrAll,"") must be copied after each call.
  • Caution: When reading a record locked in read/write mode (if HLockFile was called for example):
    • the Hyper File 5.5 engine retried indefinitely while ignoring the value of H.NbRetry.
    • the HFSQL Classic engine retries while taking the value of H.NbRetry into account.

Case HModeSemiPerso()

Type of 5.5 lock:
HModeSemiPerso()
Equivalent code:
HMode(hModeMulti)
HOnError("*",hErrLock, "_LockFailed")
Where "_LockFailed" is a global procedure of the project
PROCEDURE _LockFailed()
IF YesNo("Lock" + "Do you want to retry or exit from the program") = No THEN
  RETURN opEndProgram
END
RETURN opRetry
  • HModeSemiPerso is automatically migrated to HMode(hModeMulti).
  • The HOnError("*",hErrAll,"") code is inserted into the initialization code of the project.
  • Operations to perform:
    • Create a procedure global to the project with the following code.
    • Modify HOnError to start the global procedure.
  • If your WINDEV 5.5 code contained several calls to HModeSemiPerso, the call to HOnError must be copied after each call to HModeSemiPerso.

Case HModeAuto

Type of 5.5 lock:
HModeAuto
Equivalent code:
HMode(hModeMono)
HSurErreur("*", hErrTout, "")
  • The equivalent code is automatically inserted when migrating the project.
  • The HOnError("*",hErrAll,"") code is inserted into the initialization code of the project.
  • If your WINDEV 5.5 code contained several calls to HModeAuto, the line of code HOnError("*", hErrAll, "") must be copied after each call.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/24/2023

Send a report | Local help