Home » Developer & Programmer » Precompilers, OCI & OCCI » OCI thread safe mode ?
OCI thread safe mode ? [message #169360] Wed, 26 April 2006 07:19 Go to next message
Messages: 12
Registered: February 2006
Location: Isère (France, 38)
Junior Member
this is the official page about thread safety for OCI :

I don't understant how it works.

Oracle says :

Then the application must tell the OCI layer that the application is running in multithreaded mode, by specifying OCI_THREADED for the mode parameter of the opening call to OCIEnvCreate().

And some lines below :

If an application running in OCI_THREADED mode maintains one or more environment handles, each of which has multiple connections, it also has the following options:
Pass a value of OCI_DEFAULT to OCIEnvCreate(). In this case, the OCI library automatically gets a mutex on every OCI call on the same environment handle.

Then, if OCI_DEFAULT is passed ton OCIEnvCreate(), how can the OCI layer know that the application ruens in multithreaded mode ?????

Moreover, the doc says :

Advantages of OCI Thread Safety
Users who do not write multithreaded programs do not pay a performance penalty for using thread-safe OCI calls.

And a few lines below :

If an application is single-threaded, whether or not the platform is thread-safe, the application should pass a value of OCI_DEFAULT to OCIInitialize() or OCIEnvCreate(). Single-threaded applications which run in OCI_THREADED mode may incur performance hits.

So what ??????


PS : I don't ask these questions just to split hairs. I'm really and heavily stuck on memory and thread bogues in an OCI application, and I'm looking for all information able to help me to get out of this... ;o)

Re: OCI thread safe mode ? [message #683418 is a reply to message #169360] Mon, 11 January 2021 15:19 Go to previous message
Messages: 25
Registered: November 2017
Junior Member
(I think I might be late)
Actually, this are bits that can be combined, eg:
Previous Topic: Pro*C and 2 databases
Next Topic: Pro C program fails with
Goto Forum:

Current Time: Mon Feb 26 02:43:22 CST 2024