IBCAlerter strange problem

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
malmedin
Posts: 22
Joined: Fri 26 Mar 2010 19:52

IBCAlerter strange problem

Post by malmedin » Tue 13 Apr 2021 22:41

I had a problem in application so I created minimal test application with only one form and three components on it:

Code: Select all

IBCConnection1: TIBCConnection;
IBCAlerter1: TIBCAlerter;
IBCQuery1: TIBCQuery;
I intentionally blocked all ports on server except 3050 to test application when second connection (for events) can not be established.

Code

Code: Select all

IBCConnection1.Connected := true;
IBCAlerter1.Events.Add('TEST');
IBCAlerter1.Start;
IBCQuery1.SQL.Text := 'SELECT * FROM RDB$DATABASE';
Caption := 'Open';
IBCQuery1.Open;
Caption := IntToStr(IBCQuery1.RecordCount);
error message "invalid transaction handle" or "invalid statement handle" is shown on line

Code: Select all

IBCQuery1.Open;
Edit:
Sometimes, the error is "invalid transaction handle (expecting explicit transaction start)".

oleg0k
Devart Team
Posts: 190
Joined: Wed 11 Mar 2020 08:28

Re: IBCAlerter strange problem

Post by oleg0k » Fri 16 Apr 2021 07:59

Hello,
Unfortunately, we couldn't reproduce the issue.
Please send us an example that uses IBDAC and demonstrates the incorrect behavior, along with DDL scripts for creating and populating the database objects (or the backup file/database file). Please send them to us through the form: https://devart.com/company/contactform.html

wbr, Oleg
Devart Team

malmedin
Posts: 22
Joined: Fri 26 Mar 2010 19:52

Re: IBCAlerter strange problem

Post by malmedin » Sat 22 May 2021 22:14

I have send an example, but from your answer it seems I'm being misunderstood.

I will write excerpt from my last email here, maybe someone else can help.

I have intentionally blocked every port on server except 3050 in order to test my application in an environment where only 3050 is allowed, i.e. where secondary connection (for events) can not be established.

This prevents IBCAlerter to establish secondary connection and I am aware that IBCAlerter can not do its job (monitoring events) when it can not establish a secondary connection. In that case I would expect that IBCAlerter does one of the following (on line IBCAlerter1.Start):

- raises an exception at IBCAlerter.Start and gives me an opportunity to use try...catch statement to find out that events won't be received, but no, it just continues on the next line
- calls OnError event where I can act accordingly. By the way, what is the purpose of OnError event, it is documented but not published?
- silently stops listening

Any of the above would be acceptable, but it does not do any of that. Instead an exception is raised when opening a query (why?) and exception is not always the same. Exception is one of the following (so far observed):
- invalid database handle (no active connection)
- invalid transaction handle (expecting explicit transaction start)
- invalid statement handle
- SQL statement doesn't return rows

If I run application in Delphi IDE, the exception is always 'Unable to complete network request to host x.x.x.x'.

It seems that IBCAlerter does not properly handle situations when the server does not respond and somehow causes problems to other components. From the fact that line IBCAlerter.Start finishes in practically no time and execution continues to the next line I conclude that IBCAlerter does something behind the scene (starts thread maybe) which causes problems later.

I tested the same situation using FlameRobin using its Monitor events tool and it behaves as it should, it shows exception complaining about network request, events don't arrive, but everything else works.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: IBCAlerter strange problem

Post by ViktorV » Sat 29 May 2021 06:40

Hey,

We will consider the option of streamlining the work of the alert in the future.
In order to speed up the process you may also create a feature request on our UserVoice forum:
https://devart.uservoice.com/forums/104 ... omponents

Regards,
Viktor

Post Reply