[unixODBC-dev] RHEL 5 Linux UnixODBC/Freetds

Frediano Ziglio freddy77 at gmail.com
Fri Apr 12 10:47:51 BST 2013


2013/4/12 Prasanna Srinivasan <psriniboise at gmail.com>

> Am trying to move my compiled C code that connects to mssql database
> servers from using the datadirect odbc drivers to using the unixodbc
> driver manager (version 2.3.1)/ freetds drivers (version 0.91) which
> are already compiled for 64 bit and available to me.
>
> Am able to successfully compile it on 64 bit RHEL5 Linux by linking in
> libodbc which has already been compiled. But I get the error
> net.c:350: tds_select: Assertion 'timeout_seconds >= 0' failed
> multiple times when I run the code and the database connection fails.
>
>
I don't remember to have seen this error before!


> The environment variables I set are ODBCINI, ODBCHOME and
> LDD_LIBRARY_PATH (which is set to the libraries in the unixodbc path).
>

it's LD_LIBRARY_PATH.


> The driver in the odbcinst file is set to the path where libtdsodbc.so
> is located.
>  The permissions on the odbc.ini, odbcinst.ini files appear to be fine.
>
> I also tried linking in libodbinst and libtdsodbc (by including and
> not including libodbc)  when compiling and set the FREETDSCONF
> environment variable as well to the freetds.conf location. But I keep
> getting the same error, "net.c:350: tds_select: Assertion
> 'timeout_seconds >= 0' '. My code connects to the database
> occasionally, but for most of the part it errors.
>
> The timeout from the freetds.conf file appears to be correct:
> -----------------------------------------------------
>    # Command and connection timeouts
> ;       timeout = 10
> ;       connect timeout = 10
> --------------------------------------------------
>
>
>From this configurations timeouts are commented out.


> When I do an ldd on my executable, the dependencies are:
>
> libodbcinst.so.2 =>
> libtdsodbc.so.0 =>
>  libnsl.so.1 =>
>  libc.so.6 =>
>  libdl.so.2 =>
>  libpthread.so.0 =>
>  librt.so.1 =>
>  /lib64/ld-linux-x86-64.so.2
>
>
If you want to use unixODBC you need to link to odbc, not to our driver
directly. DM (unixODBC) will load the driver for you.

Frediano


> Am I missing something here.
>
> Thanks for your help.
> _______________________________________________
> unixODBC-dev mailing list
> unixODBC-dev at mailman.unixodbc.org
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-dev/attachments/20130412/69899258/attachment-0001.html>


More information about the unixODBC-dev mailing list