-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alterado para quando servidor DB ocupado por mais de 10 tentativas, a…
… aplicacao salva o SQL e fecha aplicacao
- Loading branch information
1 parent
b077d2f
commit f5076ad
Showing
8 changed files
with
87 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
procedure saveSQL(sql) | ||
local fileJson := appData:systemPath + 'log\recovery_sql.json' | ||
hb_MemoWrit(fileJson, hb_jsonEncode({"sql" => sql}, 4)) | ||
return | ||
|
||
procedure recoverySQL() | ||
local fileJson := appData:systemPath + 'log\recovery_sql.json' | ||
local hSQL, q | ||
|
||
if hb_FileExists(fileJson) | ||
hSQL := hb_jsonDecode(hb_MemoRead(fileJson)) | ||
hb_FileDelete(fileJson) | ||
if hb_HGetRef(hSQL, "sql") | ||
q := TQuery():new(hSQL["sql"]) | ||
if !q:executed | ||
saveLog({"DB: Erro ao executar o SQL recuperado", hSQL["sql"]}, "Debug") | ||
endif | ||
q:Destroy() | ||
endif | ||
endif | ||
|
||
return |