[unixODBC-support] Deadlock

Nick Gorham nick.gorham at easysoft.com
Sun Dec 26 17:06:31 GMT 2004

Michal Ramon wrote:

>I hope I am posting to the right list...
>Anyways, our C++ application, while using libodbc++
>and unixODBC packages, seems to get stuck quite

Yes, you are getting a deadlock. This is because unixODBC by default 
will attempt to seralize the access to the driver, as many are not 
thread safe. In your case this is causing the problem. I am guessing the 
open transaction is causing the update to wait. But because the update 
is waiting, and the driver manager is seralising things, The other 
thread can't get to the driver to finish the transaction, thats causing 
the update to wait. So deadlock.

If the driver is thread safe, then unixODBC can be lold to leave things 
alone, and only worry about protecting its own structures. In the 
odbcinst,ini entry add the entry

Threading = 0

to the particular driver section.

Of course now its up to the driver to be thread safe which shoukd be ok 
with the postgres one.


More information about the unixODBC-support mailing list