Easysoft ODBC-ODBC Bridge

How does the OOB client support connection timeouts?

Article:
00628
Last Reviewed:
28th October 2008
Revision:
2

Connection timeouts are set by an application calling SQLSetConnectAttr with the attribute SQL_ATTR_CONNECTION_TIMEOUT. Currently (OOB 1.0.0.23) only uses the connection timeout when actually connecting to the server and not for all ODBC calls. If you set the connection timeout and then the connect does not succeed in the timeout period you will get a diagnostic like this:

08001:1:4:[Easysoft ODBC (Client)]Client unable to establish connection
HY000:2:4:[Easysoft ODBC (Client)]Connection attempt timed out

However, there are some important points:

  1. Connection timeouts are not currently supported in Windows or multi-threaded versions of the OOB client for UNIX.
  2. OOB classes the connection phase as obtaining the IP address of the server machine and connecting to it. This means that if you specify the server machine as a name rather than an IP address with the ServerPort attribute, your system resolver library will be used (possibly examining /etc/hosts or performing a DNS query). On some operating systems, gethostbyname(), the call used to resolve a machine name into an IP address cannot be interrupted and the connection timeout will not work. If this is a problem for you then specify the server machine as an IP address or tell your resolver library to consult /etc/hosts before DSN and place an entry in /etc/hosts.
  3. Calls to SQLSetConnectAttr/SQLSetConnectOption for the SQL_ATTR_CONNECTION_TIMEOUT are passed on to the ODBC driver at the server end.
  4. Connection timeouts at the network level are not usable since many operating systems hard-wire them.
  5. If you are writing your own application linked with the OOB client and are working in an environment where network cables may be pulled out (network connections lost) then you can put alarm() and SIGALRM handlers (or sigsetjmp) around your ODBC calls to implement connection timeouts.
Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)


Oracle is a registered trademark of Oracle Corporation and/or its affiliates.