About management error on IBCTransaction
Posted: Tue 28 Jun 2016 10:33
Hi
In order to learn how to intercept exception on IBCTransaction, I prepare a code like this
The event OnError from IBCTransaction component doesn't intercept the execution on course ("Occurs when processing errors that are raised during executing transaction and savepoint control statements such as COMMIT, ROLLBACK, SAVEPOINT, RELEASE SAVEPOINT and others. ") as well as the OnError event from the IBCConnection...
Anyway, according to your guide, this kind of error should be generate an EDatabaseError exception ("If TDATransaction.Active is True, indicating that a transaction is already in progress, a subsequent call to StartTransaction will raise EDatabaseError.").
However It is not the case with my exemple : the ClasseName is "Exception"
is it normal ?
In order to learn how to intercept exception on IBCTransaction, I prepare a code like this
Code: Select all
try
IF NOT TransactionFB.Active THEN
TransactionFB.StartTransaction;
TransactionFB.StartTransaction; // just to create an exception
except
on E: Exception do
begin
if E is EDatabaseError then
Begin
IF Log THEN
ShowMessage( E.Message);
End else begin
IF Log THEN
ShowMessage(E.ClassName + ' with message:' + E.Message);
end;
end;
end;
Anyway, according to your guide, this kind of error should be generate an EDatabaseError exception ("If TDATransaction.Active is True, indicating that a transaction is already in progress, a subsequent call to StartTransaction will raise EDatabaseError.").
However It is not the case with my exemple : the ClasseName is "Exception"
is it normal ?