Page 1 of 1

EOraError.Sender is nil

Posted: Mon 23 Apr 2007 23:21
by jfudickar
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

Posted: Tue 24 Apr 2007 09:09
by Plash
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.

Posted: Tue 24 Apr 2007 10:17
by jfudickar
Does this mean 6.0.0.7

If yes, this is very cool 8)

Greetings
Jens

Posted: Tue 24 Apr 2007 12:25
by Plash
Yes, this functionality will be added in ODAC 6.00.0.7.