How to handle the ODBC Error "Communication Link Failure?"
- From: "Satyajit" <satyajit_rai@xxxxxxxxxxxxxx>
- Date: 20 Oct 2005 08:32:11 -0700
Hi All,
I have an C++ application that uses ODBC to access SQL server. The
application invokes the SQLAllocHandle() function to:
1. Get an Environment handle (Created only once)
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env)
2. Get Connection handle(s) by passing Environment handle
SQLAllocHandle(SQL_HANDLE_DBC, &env, &conn);
3. Get Statement handle(s) by passing connection handle
SQLAllocHandle(SQL_HANDLE_STMT, &conn, &stmt);
The application has a pool of connection handles (as created in step 2)
and reuses them. Now I am getting "Communication Link Failure" error
from the return value of the call in step 2 or step 3 (most probably
due to network failure).
I want to handle this error by retrying for a fixed number of times
before quitting the application.
My questions is - Let's say I get the "Communication Link Failure"
while trying to get statement handle (in step 3), will I need to
recreate environment and connection handles before proceeding?
In other words, do all handles get invalidated on Communication Link
Failure?
Regards,
Satyajit
.
- Prev by Date: sql time out error
- Next by Date: RE: SQL query to do a Http Post record by record
- Previous by thread: sql time out error
- Next by thread: RE: SQL query to do a Http Post record by record
- Index(es):
Relevant Pages
|