Multiple requests to xdata server to run a regular query

You have three options.

  1. Use the connection pool normally, and execute queries using the Aurelius interfaces, this way:

For UPDATE/INSERT/DELETE:

uses {...}, Aurelius.Drivers.Interfaces;  
  
var  
  Statement: IDBStatement;  
  
Statement := Manager.Connection.CreateStatement;  
Statement.SetSQLCommand(TheSQLStatement);  
Statement.Execute;  

for SELECT:

var  
  Statement: IDBStatement;  
  ResultSet: IDBResultSet;  
  
Statement := Manager.Connection.CreateStatement;  
Statement.SetSQLCommand(TheSQLStatement);  
ResultSet := Statement.ExecuteQuery;  
  
while ResultSet.Next do  
  Value := ResultSet.GetFieldValue(SomeFieldName);  
  
Finally, for both types of commands you can set parameter values:  
  
{...}  
Params := TObjectList<TDBParam>.Create;  
try  
  Statement := Manager.Connection.CreateStatement;   
  Params.Add(TDBParam.Create('id', ftInteger, 15));  
  Statement.SetSQLCommand('Delete from Customer Where Id = :id');  
  Statement.SetParams(Params);  
  Statement.Execute;  
finally  
  Params.Free;  
end;  
  1. Use the connection pool normally, then get the underlying TFDConnection component:
var
  MyConnection: IDBConnection;
  FDConnection: TFDConnection;
{...}
  FDConnection := (MyConnection as IDBConnectionAdapter).AdaptedConnection as TFDConnection;

With the TFDConnection in hands, create a new TFDQuery in each request, associated with the TFDConnection

  1. Enable FireDac pooling and simply create a new TFDConnection and TFDQuery in each request.

Do not reuse global connections or queries as it's not thread-safe.