Do triggers support transactions?
For example:
- In my PHP code I start a transaction which deletes a userID.
- This userID deletion leds to a cascade of records (from other records that point to the userID as foreign keys).
- In one of the cascaded record deletions, a trigger is called, which copies some info into another table.
If something along the way fails, would everything get rolled back, including the sql commands in the trigger?
Also, I’ve heard some people say that triggers should be avoided. Why is that?