I'm developing a messaging system in delphi using TidTCPServer and TidTCPClient.
First all clients log in with a username and a password. The server searches for the user data in SQL server using ADO components. After that the clients send multiple requests to the server every 10 seconds to tell the server that they're online and get the status of their contact list. All these requests end up with reading or modifying SQL tables.
Sometimes I get this error: Operation cannot be performed while executing asynchronously
. It's raised by ADO. I think that the TCP server is working asynchronously and multiple access to ADODataset at the same time is the problem. What should I do? Should I put the incoming requests into a list and process them one by one until the list is clear?