[freetds] dbsqlok() after dbrpcsend() hangs

Perception Technologies Ltd ptl at perceptions.co.nz
Thu Jul 5 18:16:20 EDT 2007


Tim,

It will definitely be worthwhile to try the latest snapshot.  A month ago I 
converted my code from using dbcmd() to dbrpcsend() and was getting an 
occasional hang in dbrpcsend().  It would never happen in our test system, 
and only very occasionally in our live system.

Some changes were made to the tds library which were intended to fix the 
problem (See thread"dbsqlexec() never returns" starting on 31-May-07).  We 
have yet to install it live.

Since you have a test environment that reproduces the problem, I suggest 
that you try out the current nightly snapshot, because it is likely to fix 
your problem.

Let us know how it goes.

Cheers,
         Brent.

At 5/07/2007 12:00 -0400, freetds-request at lists.ibiblio.org wrote:
>Date: Thu, 5 Jul 2007 10:56:00 +0100
>From: Tim Cook <tim at palare.demon.co.uk>
>Subject: [freetds] dbsqlok() after dbrpcsend() hangs
>To: freetds at lists.ibiblio.org
>
>I'm trying to port some existing code from using the Sybase db-lib to
>using freetds and I've encountered the following behaviour which I've
>managed to isolate in a test program which works ok when I build
>against the Sybase library but doesn't work as expected when building
>against the freetds library:
>
>o/s:            SunOS 5.8 / Solaris 8 (sun4u/sparc)
>freetds:        v0.64 built using gcc v3.4.6
>Sybase: v12.0
>
>My example code executes a stored procedure and displays the results.
>
>         dbrpcinit(dbproc, "storedproc", 0);
>         dbrpcsend(dbproc);
>         dbsqlok(dbproc);
>         dbresults(dbproc);
>         ...
>
>The above code works fine when built using the Sybase library but
>when I execute it with the freetds library the program hangs in
>dbsqlok(). Using gdb to debug the code it looks as if dbsqlok() is
>eventually calling select() to wait for a response from the server
>which it never gets and it just sits there. Setting a timeout in the
>freetds.conf file causes the select() to timeout as expected but it
>still doesn't work.
>
>As far as I can tell from reading the documentation, executing a
>dbsqlok() after a dbrpcsend() is the correct thing to do.
>
>I've also played around using dbcmd() to execute both queries
>(select) and stored procedures and that seems to work fine with
>dbsqlok() working as expected. Its only when I use dbrpcsend() that I
>encounter the problem. Unfortunately I'm dealing with legacy code and
>I probably don't have too much freedom in what I can change so I'm
>hoping I can get round this problem still using dbrpcsend().
>
>Is there something I've forgotten to setup prior to the dbrpcsend()
>call and is it worth building the test above against an earlier (or
>the nightly snapshot) version of the tds library?
>
>Thanks.
>
>Tim
>
>
>------------------------------
>
>_______________________________________________
>FreeTDS mailing list
>FreeTDS at lists.ibiblio.org
>http://lists.ibiblio.org/mailman/listinfo/freetds
>
>
>End of FreeTDS Digest, Vol 54, Issue 6
>**************************************



More information about the FreeTDS mailing list