Hello,
I'd like to understand how transaction are being committed when using plugins.
I understand there are 4 main operations -
- Pre Validation - outside transaction
- Pre Operation - inside transaction
- Post Operation (sync) - inside transaction
- Post Operation (async) - outside transaction
But what will happen in the following scenario :
- Entity A has a step registered in Post Operation (sync) that updates Entity B.
- Entity B has a step registered in Post Operation (async)
As I understand these two steps will be executed in the same transaction, even though Entity B's step is registered as async.
Does that mean that if an error occurs in Entity B's async step the entire transaction is rolled back? including changes made by Entity A's sync step?
Also, what if Entity B has a Pre Validation step as well? Will it be skipped when triggered by Entity A's sync step?
Thank you.