BDE multi-threaded error: when meeting ora-12560, can not restart TDatabase


We have a big program, using BDE + oracle, developed by delphi, We use 3 threads to do DB operations, they are using separated TSession. (1 deamon thread, 1 data collect thread, 1 checking thread)

We use this structure:

TQuery -> TDatabase -> TSession

We use this method to do query:

  qu.close;  //TQuery
  qu.sql.add('select foo from db_foos');;
  on e:Exception do
    db.close; // db is TDatabase, We use this to auto restart connection when network fail.

the problem is, when our program run more than 24 hours, ora-12560 arise, and our program cannot restart connection, and keep report this error when execute queries.

We had reviewed code, debugged all week long, and still cannot solve it, do you guys encounter the same problem?


We have this test case:

3 program, each run one thread(with 1 second sleep), and between 0.5 - 1 hour, They all failed at the same time. (3 DB operation, and 1 Indy9 ftp client...)

So I think there is something wrong in BDE or Windows socket... Current I am working on a auto restart program machanism as a workaround.

Apparently it's a common problem where the Oracle client forgets where it's supposed to be connecting. Perhaps one of these will help: