I have a little problem using triggers in MySQL.
Suppose we have two tables:
And 2 triggers:
- TriggerA: triggered when deleting on TableA and updating TableB
- TriggerB: fires when deleted on TableB and is deleted in TableA
The problem is that when I delete several rows in TableB, TriggerB starts and deletes some items in table A, then TriggerA starts and tries to update TableB.
This fails because TriggerA tries to update some rows in tableB that are deleted.
How can I avoid these circular dependencies?
None of these two triggers are useless, so I donβt know what I have to do to solve this problem.
user179476
source share