One of the new features in version 2023 is the new set of "COMMITTED" events, supported by the user business rules.
All the events (except the document specific ones) and their invocation order now look like this:
- ATTRIBUTECHANGING / ATTRIBUTECHANGED
- (AGGREGATE CLIENT) COMMIT
- (AGGREGATE CLIENT) COMMITTED
Wait a minute, what's the difference between the new COMMITTED and COMMIT?
Yes, the order of invocation, but there's one essential detail:
COMMITTED occurs AFTER the entity is actually saved to the database. This means that when COMMITTED occurs, it's guaranteed that its related entity is already updated (or created). "Physically".
When to use COMMITTED?
The main use case is when you need to be sure that the update (or creation) of the entity has completed.
This is especially useful (and needed) for data synchronization scenarios where the external application has to be notified (e.g., via a webhook) when an entity changes (or is created).
More information is available in our official documentation: