You are not logged in.
hello folks!
I am a developer of a company in Brazil. We are make migration of owner ERP this company. The technology currently used is DATASNAP and we are make adaptation for mORMot without uses of ORM. There for, we used the exemple of folder ..\16 - Execute SQL via services. Until right now, all the implementations of data access went maked successes full, but when we need used thread for make two simultaneous connection for access on server, the result is not expected! Is like if the second thread waited the first thread to be finished for maked your process! We are use FireDAC for data access e maked a small example ("162 - Execute SQL via services - Thread") based in your example 16.
New Link: https://drive.google.com/file/d/13rokeK … sp=sharing
PS:
I would like to say that my example is very simple. It only keep two connections with Web Server and use each one for make request simultaneous throw of threads. To test, i maked first query with more time response and the second more simple with response immediate! But unfortunately, the second request waited the first resquest finish.
thanks per attention!
Last edited by MARCOSMENDES (2022-08-11 12:35:13)
Offline
I have not access to you drive link, but anyway I guess that your concern is that a mORMot client is thread-safe, but blocking.
You have to use one TRestClient per thread, if you want concurrent calls.
If you have very long process, see the sample about how interface callbacks could help for a "long work" kind of request.
Offline
If it's based on 16 sample, then it's configured to execute in main thread, try to comment line with SetOptions.
Check documentation for sicClientDriven (if not needed to store some client specific data, use sicShared) and optExecInMainThread
Offline
Offline
Thanks a lot igors233! At first, to comment SetOptions solved it, but yet we to be make some tests.
Offline
See https://synopse.info/files/html/Synopse … ml#TITL_72
Those settings and behavior apply to mORMot 2 too.
Offline