Re: OCI: several processes using one lda concurrently

From: Mark <nwa_at_protocom.com>
Date: 1996/07/09
Message-ID: <4rskom$jsh_at_tracy.protocom.com>#1/1


In article <1996Jul8.154343.4536_at_sgcl1.unisg.ch> dlincke_at_bandon.unisg.ch (David-Michael Lincke) wrote:

> Is it possible without adverse side-effects for several simulatenously
> executing processes to share a common connection to an Oracle server (i.e.
> common lda and hda structures). CCursor data structures are private to each
> process of course.
>
> dave
> --
> David-Michael Lincke
> Research Assistant
> Institute for Information Management IWI-HSG, University of St. Gallen
> EMail: David-Michael.Lincke_at_iwi.unisg.ch, dlincke_at_sgcl1.unisg.ch
> URL: http://www-iwi.unisg.ch/about/team/dal.html

From what I understand, if something is going in simultaneously in a connection (i.e. lda), a mutex must be used to ensure that only one thing executes at a time. In the oracle documentation for OCI in 7.3 there is a good section on Multi-thread programming. If you are going to have only one connection per thread then you don't have to worry about a mutex semaphore to lock the resource. If you are sharing connections across threads then you must use the mutex.

One other thing, I had a problem with the function opinit which is required to initialize the multi thread environment (i.e. thread safe). I had to get a patch from oracle for solaris. If you can find the opinit function in the libclient.a library then you are set, i.e.
nm libclient.a | grep opinit

Hope this helps,
Mark Received on Tue Jul 09 1996 - 00:00:00 CEST

Original text of this message