I am using Aurelius to create a remote server for an XData project
My database is ElevateDB, which I have used for a long time on VCL projects.
Following advice in this post:
I have written an "BeforeConnect" event for my Database components.
In this mode, the FMX client Application works well while there is a single user connection. However when a second user logs on, an error message occurs:
Database name '2330854308656' already exists.
This is the "BeforeConnect" code:
procedure TServerContainer.EDBDBBeforeConnect(Sender: TObject);
var
DB: TEDBDatabase;
begin
DB := TEDBDatabase(Sender);
if DB.DatabaseName = '' then
DB.DatabaseName := IntToStr(NativeInt(DB));
end;
The database supports multiple users. I use it widely with VCL Applications and it functions well with multiple users.
The requests that are causing the errors are very trivial: Returning a single row of data with just a few fields.
Are there any other properties I should be setting on my Server Application to avoid this issue?
I have the following components on the data-module
SparkleHttpSysDispatcher: TSparkleHttpSysDispatcher;
XDataServer: TXDataServer;
AureliusConnection: TAureliusConnection;
XDataServerCORS: TSparkleCorsMiddleware;
Sess: TEDBSession;
EDBDB: TEDBDatabase;
They are set up following examples from TMS and work fine for a single user.