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

Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI and C++ Exceptions

Re: OCI and C++ Exceptions

From: Deacon Taminant <erisKILLTHIS_at_pcisys.net>
Date: Tue, 04 May 1999 19:48:02 GMT
Message-ID: <925847282.081.6@news.remarQ.com>


I've never tried to compile anything on a <blarf> NT box, but I got a lot of wacky behavior on Solaris box's trying to mix Oracle7 OCI and C++. An 'extern 'C' {}' cleared most of it up. Maybe there's something similar for NT?

Michael Krolewski <vandra_at_u.washington.edu> wrote:

: Actually, I have seen some sort of exception when initially connecting to the
: Oracle database
: when using OCI via OTL under NT 4.0/MFC C++ 5.0. It is interesting because the
: problem occurs with the first connection to the database under the debugger.
: If the try-catch block excludes the first connection, everything is OK. In
: addition, with the MFC C++, when the exception is generated and you suggest
: ignoring it and continuing, everything is OK.

: I have never bothered to track down the problem other than it is in the OCI : code somewhere.

: Mike Krolewski mikkro_at_hbsi.com

: Merrill Lynch wrote:

:> I'm using the OCI libraries on Solaris to call into an Oracle 7.3.3 server
:> running on OpenVMS.
:> Everything works fine until any of my code throws a C++ exception. The
:> code refuses to handle the exception when the executable is linked to the
:> OCI libraries.
:>
:> I've reduced the code to replicate the problem to the following:
:>
:> #include <iostream.h>
:>
:> int main(int, char**)
:> {
:> try
:> {
:> cout << "Throwing..." << endl;
:> throw 1;
:> }
:> catch(...)
:> {
:> cout << "...caught!" << endl;
:> }
:> return 0;
:> }
:>
:> When I build this without linking to the OCI libraries I works fine, i.e.
:>
:> Throwing...
:> ...caught!
:>
:> But when I link to the OCI libraries it aborts with an unhandled exception.
:>
:> Has anyone got any ideas?
:>
:> Simon.
Received on Tue May 04 1999 - 14:48:02 CDT

Original text of this message

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