Page 1 of 1

About management error on IBCTransaction

Posted: Tue 28 Jun 2016 10:33
by dehorter
Hi

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

Re: About management error on IBCTransaction

Posted: Thu 30 Jun 2016 08:49
by ViktorV
TIBCConnectin.OnError and TIBCTransaction.OnError is applied to error handling only, that are returned by the InterBase/Firebird. Not InterBase/Firebird returns the provided error, it is generated in our code. Therefore the TIBCConnectin.OnError and TIBCTransaction.OnError events are not triggered. And the exception class in this case is Exception indeed, not EDatabaseError.

Re: About management error on IBCTransaction

Posted: Thu 30 Jun 2016 09:01
by dehorter
Thanks for your quick reply

That's means that the sentence from yours supports is wrong
""If TDATransaction.Active is True, indicating that a transaction is already in progress, a subsequent call to StartTransaction will raise EDatabaseError." :lol:

regeards
olivier

Re: About management error on IBCTransaction

Posted: Thu 30 Jun 2016 10:40
by ViktorV
Thank you for being interested in our products. We will consider your comments and edit the IBDAC help.