I am trying to refresh my DbGrid when there is a change on the database using TFDEventHandler. By looking at its documentation, I saw that the TFDEventHandler is cloning the connection that had been given to it and I rather use my current, working one instead of cloning another.
Is there a way for me to use just one connection to the database to listen the events and also send queries? I am coding on Delphi 10.3 and using FireDAC to access my postgresql databases.
Unfortunately you can not. The way TFDEventHandler works is thru a background thread that keeps running on Database to check if an event occurs or not. Manly if it uses the main connection it would block your connections from other querys.
Also is really recommended if you use multiples TFDEventHandler that you use PoolConnections to it, since FDEventHandler opens a new connection and background thread for each component.