NonBlocking & breakexec -> exception

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

NonBlocking & breakexec -> exception

Post by Ludek » Thu 13 May 2010 16:00

Hi, I am just evaluating odac (as a long-term sdac user for new application) and i have following problem:
If i open a query in non-blocking mode and call breakexec, exception appears. how can i get rid of this one exception? (users should not see the exception dialog). for me, it is enough to get the onafterexecute event with result = false (which works fine).
Thanks, Ludek.

Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Post by Ludek » Thu 13 May 2010 16:34

i've found following:
http://www.devart.com/forums/viewtopic.php?t=993

but: how could i change the onerror event to make such exceptions disappear? all other kinds of exceptions should be shown to the user, just this one on breakexec should not appear.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Fri 14 May 2010 14:59

Hello

You can write the following event handler for your OraSession:

Code: Select all

procedure TForm1.OraSession1Error(Sender: TObject; E: EDAError; var Fail: Boolean);
begin
  if E.ErrorCode = 01013 then
    Fail := false;
end;
It will be catch the ORA-01013 error but other errors will be shown to user.

Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Post by Ludek » Mon 24 May 2010 17:55

Thanks, it works. but - isn't there some oraquery-level solution? I mean some proprty or event directly in the toraquery component, not only this one session-wide.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Wed 26 May 2010 09:06

Now all Oracle errors are caught by TOraSession. We will investigate the possibility of adding the OnError event to the TOraQuery in one of the next builds/versions of ODAC.

Post Reply