Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Threaded Pro*C in OAS 4.0.7

Re: Threaded Pro*C in OAS 4.0.7

From: Meng-You Yang <myyang_at_cs.stanford.edu>
Date: Thu, 13 May 1999 02:48:23 +0800
Message-ID: <7hci6g$p8i@netnews.hinet.net>


Hi!

So did that work fine after you put a mutex around the EXEC SQL statement?! Are you sure Pro*C's multi-threading is not safe?!

I'm developing web applications using Pro*C and ISAPI (Microsoft's threaded web server API). When a request comes to the web server, the web server forks a thread, which then picks an available run-time context to access Oracle. I've put mutexes around all critical sections. But it crashes under heavy traffic. I'm still checking what I've missed...

Thanks for your opinions!

ga ¼¶¼g©ó¤å³¹ <371DC14E.73E0A842_at_alerts.co.il>...
>I have tried this with oracle7 on solaris and it also was not thread
>safe. I wound up puting a lock aroud the access like this
>
>
> pthread_mutex_lock (&xclmtx);
> EXEC SQL EXECUTE
> BEGIN
> corpsrvr_int.getcorp (:sym, :result);
> END;
> END-EXEC;
> pthread_mutex_unlock (&xclmtx);
>
>I then changed my entire appl to OCI and that has no problems with
>threads.
>
>Erik Domstad wrote:
>>
>> Hello,
>>
>> I am writing a C Web cartridge for OAS 4.0.7. For the
>> database (Oracle 8.0.5) connections, I use Pro*C and
>> a little OCI8 to fetch LOBs. The OS is Solaris 7 on a Sparc Ultra 5.
>>
>> When I run the application in the console, it seems to be
>> thread safe. I can run 100 thread simultaneously calling
>> the same functions as the cartridge (with the exception of
>> calls to the WRB api that I made stubs for).
>>
>> When I run it in the OAS, it works fine single threaded but not
>> multithreaded.
>>
>> I have taken the following actions;
>>
>> Pre-compiling with the option threads=yes
>> Calling exec sql enable threads in the init cartridge callback
>> Calling OCIInitialize() with OCI_THREADED in the init cartridge callback
>> Declaring sqlca locally in each function
>>
>> What did I miss? Does anyone have any experience on the subject?
>>
>> Regards,
>> Erik
Received on Wed May 12 1999 - 13:48:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US