Delphi XE7 / XE8 - Refresh in database (real-time update)

2

I have two systems interconnected, one saves a record in the database and another reads the saved record, I currently use a timer to refresh the bank on the system that reads, so it picks up every 5 seconds that was saved by But I do not think it's the best way. Does Delphi already have some functionality that allows this type of reading in the database "persistently" or has real time?

Bank is MySql or Firebird (with firedac)

    
asked by anonymous 07.05.2015 / 18:50

1 answer

4

In general, you can use the events / notifications of the database, the exact term, and the implementation depends on the DBMS, as each uses a mechanism different. Firebird for example implements this using the POST_EVENT statement, PostgreSQL uses NOTIFY , etc.

With FireDAC, you can get alerts using the component TFDEventAlerter , the Database Alerts (FireDAC) > Embarcadero mentions:

  

The DBMS alert refers to a database notification or alert   sent by a database trigger or stored procedure   with the objective of notifying a database client about some   events on the database side.

     

An alert is identified by name and can include arguments   additional. Customers are registering with alerts. Multiple customers   can register with a single alert, and a client can register   with multiple alerts. When an alert is signaled on a   all registered customers will be notified of this.   When an alert is no longer used, the application cancels the registration for   this alert.

    
07.05.2015 / 19:35