Page 1 of 1

NonBlocking & breakexec -> exception

Posted: Thu 13 May 2010 16:00
by Ludek
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.

Posted: Thu 13 May 2010 16:34
by Ludek
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.

Posted: Fri 14 May 2010 14:59
by bork
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.

Posted: Mon 24 May 2010 17:55
by Ludek
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.

Posted: Wed 26 May 2010 09:06
by bork
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.