You are not logged in.
Hi we have some Reconnect Problem (Backend is MySQL with UniDAC) by auth?/Username=
Let me Explain
We Connect a SOA Client with mormot Authentication.
For test Reason i build up a Query Cache by Calling 20 SOA - Calls from my SOA Client.
Then i disconnect/connect my MySQL Server (To Force a Connection lost)
After this the First SOA Call returns with Error 403 (unknown user)
(Here NewStatementPrepared finds the Statement: NewStatementPrepared(select ID,LogonName,DisplayName,PasswordHashHexa,GroupRights from DFSQLAuthUser where LogonName=? limit 1) in Cache and returns without Reconnect
The Next SOA Call works because NewStatementPrepared does a Reconnect.
What do you think ? Is there an Error in the Authentication because it does not reconnect ?
Here is a Screenshot from the Log: https://ufile.io/su7052wv
Rad Studio 12.1 Santorini
Offline
From the logs, it seems indeed that the first SELECT fails with the cached statement, and the SOA call returns an error 403, whereas the 2nd SELECT intercept the error and try to reconnect.
I tried to not use the cache if the database is marked as not "Connected":
https://github.com/synopse/mORMot2/commit/e647223c
But TUniConnection.Connected does not really check the wire, then it won't be enough.
I don't see any simple way, but disabling the statement cache by setting
TSqlDBConnectionProperties.UseCache := false
Offline
Ty Arnaud, for me it works now. Using the Cache is not so Important than a successful reconnect - for Performance.
Our Trafic is very low.
Rad Studio 12.1 Santorini
Offline