Skip to Content.
Sympa Menu

freetds - RE: [freetds] Reconnection and asserts problem - tolerantness/less?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Reconnection and asserts problem - tolerantness/less?
  • Date: Fri, 5 Nov 2004 16:31:03 +0100

>
> Authors, could you help me ?
>
> I have encountered the following reconnection problem:
> My task keeps persistent connection with SQL server (MSSQL
> 2000) and periodically checks if connection is alive
> (by calling getpeername()). If the connection is lost I use
> tds_connect() to reconnect.
>
> And, in situation when connection is lost during this call, I
> get assert(in_wire == -1) and my task is broken.
> Two questions:
> 1) What's wrong in sequence of calls? Should I free and then
> allocate socket again ? I.e.:
> tds_free_socket()
> tds_alloc_socket()
> tds_connect()
> 2) Do you think that this assert is acceptable even in debug mode ?
>
> Could we (users of TDS) get more tolerant code? I mean
> tolerant to lost connections during tds_connect()
> tds_submit_xx() and tds_process_xx() ? For example, I got
> assert/abort when tried to process short simple query but
> server was heavy LOADED with night cleanings. Just timeout 60
> sec wasn't enough. Do you suppose is it a reason for assert ?
>
> At the end I am sorry for rather loud sounds, tired to fix
> these problems ;-)
>
> PS: my Configuration:
> i386
> Linux 2.4.20
> TDS 0.62.4
>

Yes, you should free and allocate again. We do not encourage the use of
libTDS, see http://www.freetds.org/which_api.html. It's subject to
change without any notice...

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page