Not seeing oracle exceptions using TOracleQuery

For some reason the only time I see oracle exceptions is when I have the delphi break on exception checkbox checked.

I'm using TOracleQuery.

I've tried catching the exceptions in a try..except block using:
e:Exceptions
e:EDatabaseError
e:EOracleError
But no oracle exceptions are raised (when break turned off).

Is there a compiler option I'm missing? Or something else I'm missing?

I'd really like to handle the exceptions.
 
There are no specific requirements:
Code:
try
  Query.Execute;
except
  on E:EOracleError do ShowMessage(E.Message);
end;
Can you post your code?

------------------
Marco Kalter
Allround Automations
 
The code in the previous message is the code I've tried:

try
...
Query.Execute;
except
on E:EOracleError do
ShowMessage(E.Message);
end;

As I said if I have the break on exception option selected in the Delphi 6 IDE then I'll see the oracle exception, but otherwise I don't.

Is there a property that needs to be set to force oracle exceptions to be raised?
 
There is no property that needs to be set. If it breaks in the IDE, then you should be able to trace execution. Does it go through the exception handler? Is it an EOracleError that occurs? What happens if you change E:EOracleError to E:Exception? This must pass through the exception handler.

------------------
Marco Kalter
Allround Automations
 
I've tried E:Exception and E:EDatabaseError and niether catches the exception. When I tried E:exception and it didn't catch the error I explicitly raised an exception Raise Exception.Create(...) just before the execute and that exception took me into the exception block, but oracle exceptions just are doing it.

I have since tried the code in Delphi 5 on a different machine and still no oracle exceptions.

I'm NOT using an Application.OnException so I'm not overriding any exception handlers.
 
I'm clueless. Can you create a little demo project that does not handle the exception, and send it to me?

------------------
Marco Kalter
Allround Automations
 
It'd be nice if I could, but I can't.

On a generic level, the code is simple.

Form creates a datamodule. This datamodule has has two TOracleSessions on it. This data module in turn creates some other datamodules (all inherited from the same baseclass) with some TOracleQuerys on them.

I drop some temptables (if any), create some new temp tables and create some dynamic sql and execute it. I just need to be able to catch the exceptions (like if a temp table isn't there when I drop it... I'd like to know that).

Other than the sessions for the queries and the SQL itself, I don't change any of the properties at run time. It's just real basic code.

Has anyone else seen this problem?
 
Back
Top