I have a class with many services that basically call Database connections (DBISAM or via ZEOS).
I am makinge this class available in a webservice like using TidHTTPServer. I am using the OnCommandGet Event from it and use the ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo to make the requests and results.
I have created a TObjectList to hold an instance of each client related to this service class. The connection to the database is created and freed for every call done, in a hope to not have thread problems.
I want to know if this is the proper way. I am not using session from the TidHTTPServer. Upon each service request I find out the object on the TObjectList that stores the info related to that connection.
I have looked over questions but I did not get all the information I need.
However I am not sure about the safety, specially when many calls can happen simultaneously. I have been using it regularly mostly 1 call per time, since is hard to test with many connections at same time.
I want to know if this is the right approach, or if not, how can I implement a "bridge" to safely call my class (I have created a QueryActivity on this class, mimicking the COM query style) passing request and returning the parameters.
Delphi XE2 - Indy 10.5.8