On Windows, yes.
On some UNIX operating systems, a thread-safe version of the Easysoft ODBC-ODBC Bridge client is not yet available. However, for Linux/glibc, Solaris/Sparc/Intel, Tru64 and FreeBSD, a thread-safe ODBC-ODBC Bridge distribution is available. These distributions have "-mt" in the filename.
There are a few issues specific to ODBC-ODBC Bridge and unixODBC regarding threads:
--enable-threads=yes
on the configure line if you want a thread-safe Driver Manager./* ** If compiled with thread support the DM allows four different ** thread strategies ** ** Level 0 - Only the DM internal structures are protected ** the driver is assumed to take care of itself ** ** Level 1 - The driver is protected down to the statement level ** each statement will be protected, and the same for the connect ** level for connect functions, note that descriptors are considered ** equal to statements when it comes to thread protection. ** ** Level 2 - The driver is protected at the connection level. only ** one thread can be in a particular driver at one time ** ** Level 3 - The driver is protected at the env level, only one thing ** at a time. ** ** By default the driver open connections with a lock level of 3, ** this can be changed by adding the line ** ** Threading = N ** ** to the driver entry in odbcinst.ini, where N is the locking level ** (0-3) **/
For mt distributions of ODBC-ODBC Bridge, you can set Threading = 0 as the ODBC-ODBC Bridge client is thread-safe.
E.g. thread1 calls SQLAllocHandle and an RPC call is made. The kernel switches to thread2, which also calls SQLAllocHandle. This also results in an RPC call. ODBC-ODBC Bridge will block thread2 until thread1's SQLAllocHandle RPC has completed.
You can get around this by making each thread open a new ODBC connection which results in multiple sockets.
E.g., suppose thread1 does something that locks table S. thread2 now attempts an operation on table S but it is locked. The ODBC driver will spin-wait thread2, so thread2 is stuck in the ODBC driver and hence as far as the ODBC-ODBC Bridge client is concerned, it has not returned from the RPC and the socket is blocked for thread1. Now when thread1 attempts to do something, the ODBC-ODBC Bridge client will block thread1, because thread2 has not returned from the RPC.