Re: [FreeTDS][SQL Server]Communication link failure

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Mon, 24 Sep 2012 15:03:59 -0300
"Reinaldo A. Fagundes" <[email protected]> wrote:

> I have a software working well with the unixodbc + freeTDS on MSSQL
> at i lost network conections
> the time out of queries generate exception and when the network come
> back I can't reconect to DB

If the TCP connection is broken, it cannot be re-established.  

If your application is timing out -- and the TCP connection is *not*
broken -- it's important to send a cancellation packet and to read all
replies until the cancellation is acknowledged.  In ODBC that's done
with SQLCancel.  

AFAIK if you get HYT00 or HYT01 from SQLFetch, you still must call
SQLCancel.  If it returns SQL_SUCCESS or SQL_SUCCESS_WITH_INFO, the
connection remains valid and can be used.  

HTH.

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.