Problems with FreeTDS/iODBC on Linux Solved?

It's quite possible that the problems I've been having with FreeTDS and iODBC on Ubuntu 10.04 are solved. One of the other guys working on this problem with me spent a little time this morning looking into this issue and seems to have found it to be a pthreads deadlock. By simply changing the threading model used by the ODBC driver, things seem to have stabilized. This is done by editing the /etc/odbcinst.ini file to include the line:

  Threading = 2

When I added this to the configuration, all the lock-up connection problems I've been having went away. It appears to be that the FreeTDS driver isn't thread-safe on the connection level, so this make sure that only one thread at the ODBC level uses a particular FreeTDS connection object at a time.

Fantastic news!