Subject Re: [IBO] Using TIB_SessionProps to catch exceptions
Author Gerhardus Geldenhuis
> That sounds correct to me. That should be only the one (default)
> IB_Session in your situation and that is the one IB_SessionProps
> should attach to.
>
> If you put a breakpoint in TIB_SessionBase.HandleException (in
> IB_Session.pas) you should be able to trace where things are going.
> The FOnError event variable of the Session, called in
> HandleException should be set by TIB_SessionProps.

Thanks for the answers so far.

I realy got lost in the code.
The only place in that specific unit where I found a FOnError variable
is the following procedure

procedure TIB_SessionBase.DoHandleError( Sender: TObject;
const errcode: longint;
ErrorMessage,
ErrorCodes: TStringList;
const SQLCODE: longint;
SQLMessage,
SQL: TStringList;
var RaiseException: boolean);
begin
if Assigned( FOnError ) then
FOnError( Self,
errcode,
ErrorMessage,
ErrorCodes,
SQLCODE,
SQLMessage,
SQL,
RaiseException );
end;

But this specific procedure does not get called not even if I trace into
with F7.

I could not determine wether the session the components use is the
default session or wether it is the session I put on the datasource.

In IBA_Statement.IMP Line 278 there is the following code

if IB_Session.ClientMonitorHooksIn then
tmpStr := tmpStr + ' stHandle=' + IntToStr(Integer(FstHandle)) + '
(ERROR)';
ErrorMessage.Add( #13#10'STATEMENT:'#13#10 + tmpStr + #13#10 );

The ClientMonitorHooksIn always returns false. I dont know if this
helps, probably not because we know it does'nt because it does call its
own event.

I also use TIBODatabase. I dont know if the ib_sessionprops links into
the connection and transaction of the tibodatabase.

Groete
Gerhardus