EOraError.Sender is nil

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

EOraError.Sender is nil

Post by jfudickar » Mon 23 Apr 2007 23:21

Hi,

how can it happen, that the EOraError.Sender Property is nil, when an exception is raised?

I want to use/show the sql-statement of the EOraError, but the property is nil when the exception raises.

I',m using 6.0.0.6

My MadExcept Exception Handler looks like the following:

Code: Select all

procedure OdacExceptHandler(const exception : IMEException;
                               var handled     : boolean);
begin
  if Assigned(Exception.ExceptObject) then
    if Exception.ExceptObject is EOraError then
      if Assigned(EOraError(Exception.ExceptObject).Sender) then
        if EOraError(Exception.ExceptObject).Sender is TCustomDADataSet then
          exception.BugReportSections.Contents['SQL-Statement'] :=
            TCustomDADataSet(EOraError(Exception.ExceptObject).Sender).FinalSQL
        else if EOraError(Exception.ExceptObject).Sender is TCustomDASQL then
          exception.BugReportSections.Contents['SQL-Statement'] :=
            TCustomDASQL(EOraError(Exception.ExceptObject).Sender).FinalSQL;
end;

initialization
  RegisterExceptionHandler(OdacExceptHandler, stTrySyncCallOnSuccess, epPostProcessing);

Any ideas?

Greetings
Jens

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 24 Apr 2007 09:09

Currently ODAC does not support detecting the component that raises an exception. In the next ODAC build we'll add the possibility to use the Component property of EOraError to detect what component raises an exception.

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Tue 24 Apr 2007 10:17

Does this mean 6.0.0.7

If yes, this is very cool 8)

Greetings
Jens

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 24 Apr 2007 12:25

Yes, this functionality will be added in ODAC 6.00.0.7.

Post Reply