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

From: J Davis <josh_d_at_magicnet.net>
Date: 1996/05/20
Message-ID: <4nqnge$4v7_at_comet.magicnet.net>#1/1


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.
 

>BUT
 
>if I try to access the database from ANOTHER thread than the main (a
>child thread), the connection is not visible (and yet it is still
>active in the main)

>is this an unresolvable bug?

If you are using post PRO*C 1.4 you can connect again in the child processes. You can connect normally or set up the connect string like this:

exec sql connect :username identified by :password using :dbname;

The dbname identifies the discrete connection to ORACLE. It is probably not necessary but will help your program to easier to understand if it knows which connection to use. Received on Mon May 20 1996 - 00:00:00 CEST

Original text of this message