Skip to Content.
Sympa Menu

freetds - RE: [freetds] FreeTDS (on FreeBSD) lost connection to remote MSSQLserver

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "FlavianoMa" <FlavianoMa.software AT teseo.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] FreeTDS (on FreeBSD) lost connection to remote MSSQLserver
  • Date: Mon, 27 Jun 2005 16:24:08 +0200

> Is there any way to detect server disconnection?
> I have FreeTDS installed from ports on FreeBSD 5.3 (version
> 5.0 as port says).
> Everything working great, but in case network problems or
> SQL server restart tds_submit_query simply returns 0
> (TDS_FAIL) with no extra information.
> Can I handle such kind of situation?

I had the same problem in the past.
Now if dbsqlexec() return with error, I call my function that:

If( DBDEAD( dbpro ) )
{
dbexit()
MyLogonFunc() // sock_init(); dbinit(); etc etc
}

After I retry the dbcmd() and dbsqlexec() and it works.

Remember that the DBDEAD() works only after called dbsqlexec() or any
function that try to use the connection.


Bye
Flaviano

Flaviano Maricotti
Software Department

----------------------------------------------------------------------------------------------

TESEO spa via Agnelli 49 63023 FERMO (AP) ITALY Tel. +39 0734 628818
Fax. +39 0734 628816

software AT teseo.com FlavianoMa.software AT teseo.com


DISCLAIMER. This electronic mail transmission may contain legally priviledge
and/or confidential information. Do not read this if you are not the
person(s) named. Any use, distribution, copying or disclosure by any other
person is stricly prohibited. If you received this trasmission in error
destroy the original transmission and its attachments without reading or
saving in any manner.
----------------------------------------------------------------------------------------------







Archive powered by MHonArc 2.6.24.

Top of Page