You are not logged in.
This used to work, but it fails my unit testing today - so I guess this is some newly introduced bug.
When calling ExecuteNoResult, it never returns.
Tracing the code, it seems the program hangs at mormot.db.sql, line 3492, TSqlDBConnectionProperties.NewThreadSafeStatementPrepared
function TSqlDBConnectionProperties.NewThreadSafeStatementPrepared(const aSql:
RawUtf8; ExpectResults, RaiseExceptionOnError: boolean): ISqlDBStatement;
begin
result := ThreadSafeConnection.NewStatementPrepared(aSql, ExpectResults,
RaiseExceptionOnError);
end;
Any advice? Seems like a new bug, or something that breaking changes for the existing code?
Last edited by wxinix (2022-01-06 03:12:01)
Offline
I don't remember changing anything at that level.
With with DB and TSqlDBConnectionProperties class and compiler?
Where does it hang exactly (within ThreadSafeConnection or within NewStatementPrepared)? Could you debug a little?
Edit: perhaps it is about the new TRWLightLock use in SqlDBConnectionPropertiesThreadSafe.ThreadSafeConnection.
But I am not able to reproduce the issue.
Offline
Thank you.
I downloaded latest commit as of 8:11am, Jan 6, 2022 (Eastern Time). This seems to fix the "hanging problem" of the unit test case (as reported above), and that test case was able to pass.
But then, another test case fails, at mormot.core.json, line 3196-3236, function GotoEndJsonItemString(P: PUtf8Char): PUtf8Char;
it hangs inside that function, and was never able to return.
The following is the call stack:
mormot.core.json.GotoEndJsonItemString
mormot.orm.core.TOrmTableJson.ParseAndConvert
mormot.orm.core.TOrmTableJson.CreateFromTables
mormot.orm.storage.TRestStorageInMemory.LoadFromJson
mormot.orm.storage.TRestStorageInMemory.ReloadFromFile
mormot.orm.storage.TRestStorageInMemory.Create
...
Any thoughts?
Last edited by wxinix (2022-01-06 13:29:54)
Offline
What is the JSON input in the function?
Please try https://github.com/synopse/mORMot2/commit/3253bf05
Offline
I think there is a bug with function GotoEndJsonItemString(P: PUtf8Char): PUtf8Char;
Line 3231, mormot.core.json:
else if P^ = #0 then
break
else if P^ <= ' ' then
continue; // <== once the loop end up in this branch, the loop will never be able to break, because P stops increment!!
Last edited by wxinix (2022-01-06 15:04:57)
Offline
Yes, please try https://github.com/synopse/mORMot2/commit/3253bf05
Offline
Offline