Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Database/Performance    [ Add a report in this area ]  
Report #:  135088   Status: Open
[FireDac] [MS SQL] [TFDEventAlerter] Bad performance when unregistering events
Project:  Delphi Build #:  21.0.17707.5020
Version:    21.0 Submitted By:   Martin Stuhlmüller
Report Type:  Issue Date Reported:  12/7/2015 3:06:59 AM
Severity:    Critical / Show Stopper Last Updated: 12/14/2015 6:22:36 AM
Platform:    All platforms Internal Tracking #:   72854
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Unregistering events on a MsSQL Server 2014 lasts at least 3 seconds per event.

It is very annoying for the users to wait 10-12 seconds before the program closes.

If I drop the services and queues manually, the performance isn't a problem.
Steps to Reproduce:
procedure TForm1.FormCreate(Sender: TObject);
begin
  FDEventAlerter2.Active := False;
  FDEventAlerter2.Names.Clear;
  FDEventAlerter2.Names.Add('QUEUE=?');
  FDEventAlerter2.Names.Add('SERVICE=?');
  FDEventAlerter2.Names.Add('CHANGE1=ev1;select ID from dbo.ABC');
  FDEventAlerter2.Register;

  FDEventAlerter1.Active := False;
  FDEventAlerter1.Names.Clear;
  FDEventAlerter1.Names.Add('QUEUE=?');
  FDEventAlerter1.Names.Add('SERVICE=?');
  FDEventAlerter1.Names.Add('CHANGE2=ev2;select ID from dbo.ABC');
  FDEventAlerter1.Register;
end;

procedure TForm1.FormDestroy(Sender: TObject);
var SL: TStringList;
begin
  SL := TStringList.Create;
  SL.Add('1: ' + FormatDateTime('hh:mm:ss:zzz', Now));
  FDEventAlerter2.Unregister;
  SL.Add('2: ' + FormatDateTime('hh:mm:ss:zzz', Now));
  FDEventAlerter1.Unregister;
  SL.Add('3: ' + FormatDateTime('hh:mm:ss:zzz', Now));
  FDConnection1.Connected := False;
  SL.Add('4: ' + FormatDateTime('hh:mm:ss:zzz', Now));
  SL.SaveToFile('alert.log');
end;
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01