How can I keep my DB connection from failing when the network is unstable?

后端 未结 5 1867
攒了一身酷
攒了一身酷 2021-02-10 15:01

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

5条回答
  •  没有蜡笔的小新
    2021-02-10 15:34

    I suggest the following on Database Component.

    1. do connect on every sql and close on completion.
    2. Use connection timeout & restart query if there is a timeout
    3. If database is disconnected, spool the data to a local database on the client and restart transmission to the central database once there is connectivity again. This way you do not loose any data.
    4. Use a timer to check for central Database connectivity to do spooling of untransmitted data.

    This problem is common for shopfloor data collection and the suggestion above is the only way I could effectively handle the problem.

提交回复
热议问题