Subject Re: [IBO] Using TIB_SessionProps to catch exceptions
Author Jason Wharton
Are you also using a TIB_Session component? If so this will make things
align to the explicit session you have created instead of the default one
that the TIB_SessionProps component is designed to give you access to.

In short, don't use TIB_SessionProps and TIB_Session at the same time.


Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

-- We may not have it all together --
-- But together we have it all --


----- Original Message -----
From: "Gerhardus Geldenhuis" <gerhardus@...>
To: <IBObjects@yahoogroups.com>
Sent: Friday, October 11, 2002 12:49 AM
Subject: Re: [IBO] Using TIB_SessionProps to catch exceptions


> > 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