Re: Connecting to a Database using PRO*C in a multithreading environment

From: Scott Urman <surman_at_oracle.com>
Date: 1996/05/21
Message-ID: <4nta43$44c_at_inet-nntp-gw-1.us.oracle.com>#1/1


In article <4nsdok$orq_at_wagner.spc.videotron.ca>, dominict_at_keops.com (D. Turpin) writes:
|> I am using Pro*C version 2.1.2.0.3
|>
|> Problem is, a reconnect takes about 5 seconds...which I cannot afford
|> Heck, im real time here, I have less than 500ms!
|>
|> josh_d_at_magicnet.net (J Davis) wrote:
|>
|> >dominict_at_keops.com (D. Turpin) hurled up:
|>
|>
|>
|> >>How can one make a connection to a database visible through all
|> >>threads of the application?
|>
|>
|> >>the thing is, if I connect to my database in my main thread and access
|> >>data from there, there's no problem.

Starting with Pro*C 2.2 (Oracle 7.3) the libraries are thread-safe. You can share a connection among multiple threads as long as you mutex each SQL statement. You can also have each thread make its own connection.

|>

 [snip]
|>
|>
 

-- 
------------------------------------------------------------------------
Scott Urman            Oracle Corporation           surman_at_us.oracle.com
------------------------------------------------------------------------
Author of _Oracle PL/SQL Programming_ ISBN 0-07-882176-2
Published by Oracle Press - http://www.osborne.com/oracle/index.htm
------------------------------------------------------------------------
"The opinions expressed here are my own, and are not necessarily that of
 Oracle Corporation"
------------------------------------------------------------------------
Received on Tue May 21 1996 - 00:00:00 CEST

Original text of this message