Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between those 2 events in Magento?

What is the difference between <catalog_category_save_after> and <catalog_category_save_commit_after> in Magento?

I'm going to create a new module and i have to decide in which of those two events to hang my observer.

like image 450
Nikitas Avatar asked Dec 03 '13 10:12

Nikitas


1 Answers

The category (and all other objects) are saved inside a transaction. The event catalog_category_save_after is triggered inside the transaction. So any error that might appear in the observers of this event will trigger a rollback.

The event catalog_category_save_commit_after is triggered after the transaction is commit-ed. So any error inside the observers for this event will not trigger a rollback for the category save.

like image 140
Marius Avatar answered Sep 26 '22 19:09

Marius