OpenAccess SDK supports multithreading to allow efficient use of computer resources and concurrent execution of queries. OpenAccess SDK uses thread-per-connection by default on platforms that support multithreading. Alternatively, OpenAccess SDK Service can be configured to run in thread pool or process-per-connection models.
Refer to OpenAccess SDK Administrator’s Guide for more details on the connection models and how to configure a connection model using the ServiceConnectionModel attribute.
When running the OpenAccess SDK Server in the thread-per-connection model, the OpenAccess SDK Server creates a new thread for each connection and calls the CONNECT operation in the IP on this thread. All subsequent calls into the IP take place on this same thread.
The C/C++ IP must be written to be reentrant, as concurrent threads will call the various IP functions. This means you cannot use global variables without proper protection.
For Java and .NET IPs, a new instance of the IP class is created for each connection.
In the local configuration, the OpenAccess SDK ODBC component concurrently supports multiple client threads to be active. The IP must be written to be reentrant as concurrent threads will call the various IP functions. The IP must not assume that the calls for a connection will be on the same thread. Do not use thread local storage. If multithreading is disabled, then calls to ODBC are serialized, and the IP functions do not have to be thread safe.
For more information on handling threading issues, refer to the specific OpenAccess SDK Programmer’s Reference for your programming language.