A issue happens when your program crashes and blocks database access, or when an error dump file fails to open because another process locks it.
Any active transaction attempting to write during the dump will fail with an error message like: "File locked by another application. HFSQL error code: [xxx]" . Without proper error handling, this leads to data loss for the end user.
Build a "Maintenance Flag" into your database. Before performing index repairs or structure updates, have the application check this flag and prevent users from logging in.
Info("System backup will start in 30 seconds. Please save your work.") Sleep(30000) IF HDump("SALES", "C:\Backups\sales.wdb", hExclusive) THEN Info("Backup complete.") END
To minimize the occurrence of exclusive lock issues during critical errors, adhere to these operational guidelines:
// In a method or procedure WHEN EXCEPTION IN // Code that might fail hModifyStructure(...) DO // Save the dump to a file dbgSaveDebugDump("C:\Logs\Error_" + DateSys() + "_" + TimeSys() + ".wdump") Error("A serious error occurred. A dump was saved.") END Use code with caution.
WINDEV 25 introduces several groundbreaking features:
The IDE will load the debugger, placing you at the exact line of code and state where the dump was generated. Key Components of a Windev 25 Dump