Hi, I have a standard XDataServer with connection to a MS-SQL server that "normally" works great:
but it happens that sometimes I get connection losses like these:
I could simulate something similar in a development environment by de-attaching the ethernet cable (I get a different error, like "non existing server"... but the idea is to fire some comm problem).
I've found no way to re-establish native connection once it's lost... setting the dispatcher.active to false then back to true has no effect - suggestions?
Thanks for suggestion, I've already found some days ago that article while browsing around and looking for solutions.
What I'm stuck on is that, after trapping the connection error inside a try except block, I found no way to re-establish further connections... no solution but re-launching the exe.
Could it be that the pool is not detaching the broken connection? I'm assuming that XDataConnectionPool is capable of handling all the low-level stuff, but maybe that's not true when conn errors are coming.
This is happening with native connection. If I'm using adapters like Firedac system gets back to working state when network becomes available again.
The pool doesn't handle broken connections, it's up to the connection to re-establish itself. Native connection doesn't have a specific mechanism for that, that's why I suggested some connection configuration that likely makes the ODBC driver itself to re-establish the connection.
Thank you very much for the details above.
It seems to me that handling this will be trivial only using an adapter, like FDConnection with MSSQL driver, and keeping default options
this means using Delphi Enterprise at minimum in development, since Professional license does not ship with needed components.