Does the after Update trigger will kick off if there is a rollback?
Scenario: Lets say we update a table A and the trigger on table A kicks off and updates another table B with the details. If there is a rollback issued on table A due to some processing error, will the trigger cause the table B to rollback the change?
Yes, it will.
Triggers work in scope of the DML
statement's transaction (either started by you explicitly or by the DML
statement itself implicitly)
When this transaction is rolled back, all changes made by the triggers are also rolled back.
However, if you put
PRAGMA autonomous_transaction
into the trigger definition, the trigger will start its own transaction which you should commit before the trigger completes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With