Oracle Community Directory
Oracle Community FAQ
My Oracle Support Community (MOSC)
Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
OTN Speaker Bureau
Database Application Development
Oracle Call Interface (OCI)
Please enter a title.
You can not post a blank message. Please type your message and try again.
This discussion is archived
: Jul 12, 2012 2:22 PM by
MULTI_TREADING with OCI
Jul 12, 2012 2:22 PM
We do the following in an OCI program :
1. The environment is properly initialized with OCI_THREADED (and without OCI_ENV_NO_MUTEX).
2. Two threads A and B are involved.
3. Thread A creates and properly sets up a service context handle and a session handle.
4. Both threads A and B use the same service context and session handles (though never concurrently). This works fine.
5. At one point, thread A ends. Thread B continues to execute.
6. After A ends, thread B gets an OCI_INVALID_HANDLE when it attempts to use the service context and session handles.
7. Note that thread B would have closed the handles before ending, but does not have the chance to get that far.
Is that normal? Is it forbidden to share service context and user session handles amongst threads? The documentation strongly suggests otherwise.
We are using Oracle client 11G Release 1 and the server is also at the same version.
This content has been marked as final.
Show 0 replies