FireDAC.Comp.Client.TFDEventAlerter

From RAD Studio API Documentation
Jump to: navigation, search

FireDAC.Comp.Client.TFDCustomEventAlerterFireDAC.Stan.Intf.TFDComponentSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTFDEventAlerter
[–] Properties
Type: class
Visibility: public
Source:
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
Unit: FireDAC.Comp.Client
Parent: FireDAC.Comp.Client

Delphi

TFDEventAlerter = class(TFDCustomEventAlerter)

C++

class PASCALIMPLEMENTATION TFDEventAlerter : public TFDCustomEventAlerter

Description

The class responsible for handling the database event notifications.

Use the TFDEventAlerter class to handle the database event notifications.

The general behavior of the events is DBMS-specific and TFDEventAlerter provides a unified way for handling them.

Example

FDEventAlerter1.Options.Kind := 'DBMS_ALERT';
FDEventAlerter1.Names.Text := 'Customers';
FDEventAlerter1.Options.Synchronize := True;
FDEventAlerter1.Options.Timeout := 10000;
FDEventAlerter1.OnAlter := DoAlert;
FDEventAlerter1.OnTimeout := DoTimeout;
FDEventAlerter1.Active := True;
........

procedure TForm1.DoAlert(ASender: TFDCustomEventAlerter;
  const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh;
end;

procedure TForm1.DoTimeout(ASender: TObject);
begin
  qryCustomers.Refresh;
end;

See Also