You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To safeguard against concurrent repository updates overwriting each other's changes, a version field was introduced in all snapshots that are expected to be updated atomically in repository updates.
With these modifications in place, infrastructures using CARP core can now verify on repository writes whether the version of the snapshots in the DB match those of the expected fromSnapshotVersion from the AR which is loaded in memory and on which edits were performed. If not, this means a concurrent incoming requests manipulated the same AR, and an exception can be thrown. This exception can be handled uniformly by retrying the whole request.
Could even more guidance be given, and potentially specific database technologies for transaction management be used, by implementing a unit of work pattern on repository interfaces?
For example, MongoDB has read isolation, which if units of work get communicated to repository calls, could be used to achieve the same as verifying the version field.
The text was updated successfully, but these errors were encountered:
This may also be important to safeguard that a repository update and matching domain event which is published occur as one transaction.
Currently, if a repository call succeeds, but an event bus call fails before it reaches a messaging bus, the system will end up in an inconsistent state.
To safeguard against concurrent repository updates overwriting each other's changes, a
version
field was introduced in all snapshots that are expected to be updated atomically in repository updates.Could even more guidance be given, and potentially specific database technologies for transaction management be used, by implementing a unit of work pattern on repository interfaces?
For example, MongoDB has read isolation, which if units of work get communicated to repository calls, could be used to achieve the same as verifying the
version
field.The text was updated successfully, but these errors were encountered: