Hi,
i have a Sparkle Server, with different TRemoteDb modules added (about 20 different URL / db's).
There is already a way in Sparkle to know, at a certain moment, the total number of active connections ? Or i have to implement some sort of a thread-safe counter ?
If i do it this way, what do you think is the best place for the code that does the counter adding / subtracting 1 ? Maybe the Create / Destroy events of the TRemoteDb datamodules ?
Thank you
Arnaldo
Hi Arnaldo,
Thank you Wagner, maybe i have some thing that i have misunderstood...
When a client application connect to the Sparkle server via TRemoteDb, the TRemoteDb module with the right URL is activated, and his TDbConnectionFactory is created. In my server, the ConnectionFactory creates a Datamodule. I thought that this operation would be one-to-one, so if i have 50 applications connected to Sparkle / TRemoteDbModule, i have also 50 datamodules created. Now, in my assumption, i would like to know how many datamodules i have in a certain moment.
I have to re-read the manual !
Arnaldo
It is more or less like that, but suppose your client takes too long to perform another connection, the database in server will disappear. For the client it looks like it's still "connected" (a new SQL execution will create a new database in server), but in the server the database won't be there.
Thank you Wagner,
happy for the news, the statistics are something relevant (at least in my case !). Maybe it's because the servers in cloud are a bit pricey, and we always tend to "consume" entirely a server, before adding another....
Thanks again, have a good day
Arnaldo