[unixODBC-dev] Re: Concurrent SQLs with unixODBC DriverManager and DB2 CLI ODBC driver

Nick Gorham nick.gorham at easysoft.com
Thu May 31 06:14:41 BST 2007

Damodaran, Vinod wrote:

> Hi,
> I want to execute SQLs concurrently using the unixODBC DriverManager 
> and the DB2 CLI ODBC driver.
> I am running this on Linux RHEL4 (Update 1) 64 bit with DB2 9.1
> I have written a test program which spawns multiple threads and 
> executes the same SQL within these threads (I acquire and release 
> Mutexes so that the threads run concurrently)
> When I tried this with the unixODBC DriverManager and the DB2 CLI ODBC 
> driver, I find that the SQLs run serially
> When I replaced the unixODBC DriverManager with DataDirect, the SQLs 
> run concurrently.
> Nick Gorham suggested that I use “Threading=0” with the unixODBC 
> DriverManager, but when I use this option, I find that all but one 
> thread gives me a SQLError:
> SQLError on SQLConnect():
> code = SQL_ERROR
> state = IM005
> nativeErrorCode = 0
> sqlErrorMessage = [unixODBC][Driver Manager]Driver's SQLAllocHandle on 
> messageLength = 74
Just to add to this, I have tested the app using a different driver and 
its fine. I suggested that it was posted here to see if anyone knew if 
there were any issues in the DB2 driver with multiple concurrent calls 
to SQLAllocHandle( SQL_HANDLE_DBC )


More information about the unixODBC-dev mailing list