Some ODBC functions can be run concurrently on statements that share the same connection, while other functions block.
For example, the ODBC catalog function
SQLTables cannot be run concurrently. Suppose a thread is executing
SQLTables on a statement, while another thread attempts to execute a function on another statement that shares the same connection. The second thread blocks until
SQLTables on the first thread is finished.
This section explains the concurrency behaviour for the different ODBC functions, and explains how to change the behaviour from concurrent to blocking.
By default, the following ODBC functions support concurrency:
These functions can be executed concurrently, even if the statements that are executing them share the same connection. For example, suppose a statement is executing a function on a connection. If you pass that connection handle to
SQLAllocHandle() function is executed concurrently and does not block.
Similarly, suppose two statements,
Statement2, are using the same connection.
Statement1 is already executing. You can call
Statement2 and it will not block.
If you want these functions to block by default, you can change the default behaviour by setting a driver property.
To set ODBC functions to block:
IDriverimplementation, set the DSI_DRIVER_ALLOW_INCREASED_ODBC_STATEMENT_CONCURRENCY property to
The following ODBC functions do not support concurrency: