At least, the driver should protect handles within ODBC functions. That is, if multiple threads, using the same handle, simultaneously call ODBC functions, the driver should serialize access sufficiently to ensure operations are consistent on the handle. This is function-level thread safety.
The larger consideration is that ODBC handles carry state information between function calls. The ODBC drivers could protect this state information in some cases, but ultimately, some of the responsibility for thread safety falls on the application:
The application must provide some synchronization of access to ODBC by multiple threads, even when using thread-safe ODBC drivers.
This article discusses these issues in detail. It describes the problems and provides general, portable solutions. The article has the following sections:
|Return To Issues Page|