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
Herode
Messages: 12
Registered: February 2006
Location: Isère (France, 38)
Junior Member
Gentlemen,
this is the official page about thread safety for OCI :
http://oraclesvca2.oracle.com/docs/cd/B10501_01/appdev.920/a96584/oci...

I don't understant how it works.

Oracle says :
Quote:

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 :
Quote:

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 :
Quote:

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 :
Quote:

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 ??????

Regards,
C.


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
NevemTeve
Messages: 25
Registered: November 2017
Junior Member
(I think I might be late)
Actually, this are bits that can be combined, eg:
OCI_DEFAULT == 0
OCI_THREADED == 1
OCI_THREADED|OCI_NO_MUTEX == 0x81
Previous Topic: Pro*C and 2 databases
Next Topic: Pro C program fails with
Goto Forum:
  


Current Time: Thu Mar 28 15:38:16 CDT 2024