[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetds
Subject:    RE: [freetds] FreeTDS (on FreeBSD) lost connection to remote
From:       "FlavianoMa" <FlavianoMa.software () teseo ! com>
Date:       2005-06-27 14:24:08
Message-ID: 2504C2FC34F49242B4AB0E200FE231A02DB454 () hal ! TWPN ! NET
[Download RAW message or body]

> 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@teseo.com      FlavianoMa.software@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.
----------------------------------------------------------------------------------------------
  


_______________________________________________
FreeTDS mailing list
FreeTDS@lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic