We have a application that uses BDE connected to an Oracle DB.
I use TQuery for the SQL queries, and it connects to TDatabase, we are not professional programmers, and we do
Sorry for the short answer... fix your network. That is really the best option for you at this point.
I suggest the following on Database Component.
This problem is common for shopfloor data collection and the suggestion above is the only way I could effectively handle the problem.
Use DBExpress technology instead of ADO of anything else. The structure dbquery + provider + Clientdataset is "disconnected" by design.
You can test simply opening a dataset, drop the connection, reconnect and post the data.
By the way, with DBExpress it's easy to upgrade an application to a n-tier scenario.
Going to an n-tier solution might also help... especially if the middle tier is also on the database server so its connection is local. Most of the recent implementations for Delphi use a custom HTTP server as the middle tier, the advantage of such is that the connection is only required for the current request being performed..once the request is complete, the connection can be severed without any problems.
Try to implement a "watchdog" thread that :
Take into account that any transaction might not succeed at all, and save that information somewhere. Then, upon connecting via "watchdog" thread, try to preform that transaction again, if the nature of transaction allows so.