Test connection problem!!!

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
maxdf
Posts: 3
Joined: Wed 14 Sep 2005 09:52

Test connection problem!!!

Post by maxdf » Wed 14 Sep 2005 15:04

Platform Linux & Kylix3 C++

We are evaluating your products ORACLE & MySQL dbexpress and we are testing
them in failure situations (network problem: disconnect client/server cable, server shutdown, ecc).

Network problem

ORACLE NET: we have disconnected client network cable and executed
this command sqlConn->GetTableNames(pList). In this situation the application stays blocked for about 45 minute
and then raises an exception.

MySQL Core Lab: same as ORACLE NET.

Server Shutdown

MySQL Core Lab: we made the DB server shutdown and executed
this command sqlConn->GetTableNames(pList). In this situation we receive an empty pList in few second.
(that's OK this could be a way to verify a connection)

QUESTION:
What is the best technique to verify the connection status?

We need to know if DB server is connected before execute any sql query command, and we cannot wait for a long time.


Thanks
Max

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Thu 15 Sep 2005 12:08

We have tested the following configurations: "MySQL (Core Lab)", "MySQLDirect (Core Lab)", "Oracle (Core Lab)", "Oracle Net (Core Lab)" in both modes: direct and using client software. We disconnected the network cable and watched the socket waiting until the connection was established again. Afterwards application continued to work without errors.
It seems like a common problem with sockets in Linux. Possibly this can be configured in Linux to close socket immediately when a connection is broken.

maxdf
Posts: 3
Joined: Wed 14 Sep 2005 09:52

Post by maxdf » Fri 16 Sep 2005 07:02

We have monitored the socket connection with "netstat" and we have
seen the sockets stay established also when the cable is disconnected
for some minutes. I'm conviced by your suggestion, anyway I would like
to ask you:

What is the best technique to verify the connection status with dbexpress components?

Any suggestions will be appreciate?


Thanks
Max

Post Reply