Good morning people,
I would like to ask for your help, if anyone can help, I am very grateful.
The question would be fairly simple, How to work with Multi Thread in FireDac? In other databases, such as DBISAM, you have a Session component, you just have to configure this component and everything is solved, but firedac does not have this component.
Better explaining the case:
I developed a REST server in Delphi using DataSnap to export data from a database (Firebird) to mobile devices.
The connection to the database is made by the FireDac components. When I start the server I connect to the database, the connection is established until the server is closed.
By doing some tests, I realized that when a device performs the requests everything works perfectly, but the problem arises when several devices make simultaneous connections , there are several errors, Access Violation and database errors.
To correct these errors, in each method requested on the server start a new connection to the database. By doing this the errors no longer occur and I can connect several devices simultaneously. I know this is not the right way, I realized at the outset that the process was VERY slow, because every request started a new connection.
Then I would like to know how to work with sessions on FireDac, so each request on the server does not influence other connections.
Thank you in advance.