Subject | Using TIB_SessionProps to catch exceptions |
---|---|
Author | Gerhardus Geldenhuis |
Post date | 2002-10-10T07:56:33Z |
Hi
I have just read
Handling Exceptions - Delphi, CPPB, IBO and Firebird/InterBase
This document suggest that TIB_SessionProps is a handy component to to
centralised exception handling.
Three questions:
I have two datamodules but one application and no threading programmed.
I do have multiple connections. I assume all of this connections belong
to the same session if I read the helpfile correctly, thus I dont need
more than one?
I have put some very simple code in the onerror event of the
TIB_SessionProps component. It gets compiled but never gets called why
is that. I have put breakpoints on the entire procedure to check if it
gets called.
Is there some property that I must set first? I have looked in the help
file... Almost none of the properties of a TIBOQuery have any
explanations of what they do.
procedure TDBR.IB_SessionProps1Error(Sender: TObject;
const ERRCODE: Integer; ErrorMessage, ErrorCodes: TStringList;
const SQLCODE: Integer; SQLMessage, SQL: TStringList;
var RaiseException: Boolean);
begin
if ERRCODE = 335544665 then
showmessage('an primary key exception');
end;
If I have centralised exception handling in the form of a
TIB_SessionProps and I have a OnPostError for a TIBOQuery, does both get
called and if so who first or does only one get called.
Thanks
Groete
Gerhardus
I have just read
Handling Exceptions - Delphi, CPPB, IBO and Firebird/InterBase
This document suggest that TIB_SessionProps is a handy component to to
centralised exception handling.
Three questions:
I have two datamodules but one application and no threading programmed.
I do have multiple connections. I assume all of this connections belong
to the same session if I read the helpfile correctly, thus I dont need
more than one?
I have put some very simple code in the onerror event of the
TIB_SessionProps component. It gets compiled but never gets called why
is that. I have put breakpoints on the entire procedure to check if it
gets called.
Is there some property that I must set first? I have looked in the help
file... Almost none of the properties of a TIBOQuery have any
explanations of what they do.
procedure TDBR.IB_SessionProps1Error(Sender: TObject;
const ERRCODE: Integer; ErrorMessage, ErrorCodes: TStringList;
const SQLCODE: Integer; SQLMessage, SQL: TStringList;
var RaiseException: Boolean);
begin
if ERRCODE = 335544665 then
showmessage('an primary key exception');
end;
If I have centralised exception handling in the form of a
TIB_SessionProps and I have a OnPostError for a TIBOQuery, does both get
called and if so who first or does only one get called.
Thanks
Groete
Gerhardus