You are not logged in.
Pages: 1
Hi,
I have a SOA server (TSQLRestServerFullMemory) which defines service IMyService as follows:
MyServer.ServiceDefine(TMyServiceImpl, [IMyService], sicShared);
I have a SOA client (TSQLHttpClient) which calls some methods of above interface periodically (1 call per second).
FClient.ServiceDefine([IMyService], sicShared);
RemoteService := FClient.Service<IMyService>;
When client uses only one thread to call RemoteService methods - everything works fine.
When I create 10 threads which do the same - I'm getting access violations.
I have tried different ways with no success:
1. use one TSQLHttpClient for all threads
2. create TSQLHttpClient for each thread
3. use sicPerThread instead of sicShared
I have a feeling that I'm missing something, but cannot figure out for couple of days already.
Any help is appreciated.
Thanks.
Offline
Access violation of the client side?
Of course, since TSQLHttpClient is supposed to be used from a single thread.
So either you use solution 1 and a lock/mutex, or you use 2.
Solution 3 is only for server side: it makes no sense on the client side.
Offline
Sorry, forgot to mention: yes, access violation is on the client side.
Solution 1: Do You mean to put a lock/mutex for all calls to RemoteService methods?
Solution 2: Having separate TSQLHttpClient for each thread did not help. Does it need lock/mutex for RemoteService method calls as well?
Offline
Pages: 1