Hi,
I have a custom Delphi DA server (MySQL database). I use triggers on the MySQL server, where each records delete on tables are written to log tables. This is used mainly for Windows clients.
When I apply updates from IOS I don’t want these datas to be written on this log table. But the sync from IOS fires these triggers also.
Is there a way to disable the triggers during this sync ? Or is there a way to have on Delphi side some events when some rows has to be deleted (so I will remove them in the log table after the sync) ?
Regards
The whole point of a trigger in the db is the independence of client implementation.
However, If MySql support a way to send the client name (like a UserAgent) then you could filter it inside the triggers…
Hello,
Armindo said: Is there a way to disable the triggers during this sync ?I don't think it is possible to disable database triggers from DA application during the sync.
Armindo said: Or is there a way to have on Delphi side some events when some rows has to be deleted (so I will remove them in the log table after the sync) ?
You coud use for this data service events BeforeProcessDeltas or AfterProcessDeltas, check if delta’s change type is delete - then add records in the log table. The same check could be carried out in business processor events onAfterProcessChange, onAfterPocessDelta, onBeforeProcessChange, onBeforeProcessDelta.
Best regards