Re: Multiple db connections with C++/ProC

From: Jason Judge <jason.judge_at_virgin.net>
Date: Mon, 1 Nov 1999 22:41:24 -0000
Message-ID: <7vl496$6bf$1_at_nclient13-gui.server.virgin.net>


Pro*C will open up any number of connections for you. But you must give each connection a unique name and use this name in each SQL statement to identify which connection is to be used. This is done at design time and not on the fly.

I have used this method to do database updates on one connection - rolling back when an error occurs - and write log messages to another connection and commiting independantly.

One disadvantage of this method is that the Pro*C compiler does not perform full sematics checking when you compile (since it knows there will be more than one connection and it can't log on to the database to check each SQL statement under its intended connection). However, this does speed up compilation when using embedded procedure calls when compilign on a slooooww machine.

JJ

Ben Branch <benson.branch_at_lucent.com> wrote in message news:3819DCBA.853CB1ED_at_lucent.com...
>
> Greetings,
>
> I currently have a program written in C++ (Solaris)
> that uses ProC to do array inserts into Oracle,
> approximately in the style,
>
> EXEC SQL FOR :batch EXECUTE CURSOR_1 USING ...
>
> Now I need to know if it is possible to have
> the one process (thread?) do inserts into
> multiple databases without constantly closing
> one and opening another, which I fear would
> be disastrous for performance. Some records go
> to one ORACLE_SID, some to another, some potentially
> to yet another.
>
> Any pointers to examples or documentation would
> be especially appreciated.
>
> Thanks in advance,
> Ben
>
> P.S. This is Oracle 8.0.5 and 8.1.5.
>
> --
> Ben Branch
> bensonbranch_at_lucent.com
> 614-860-4790
Received on Mon Nov 01 1999 - 23:41:24 CET

Original text of this message