Hi Dojo,
What's the process when user A reads a DOM Instance and user B writes to the same DOM Instance at the same time? Will writes takes precedence over reads? Can it happen that a part of the data is already adapted resulting in user A having a "corrupted" instance?
Hi Jens,
User A would always read either the full old version or the full new version that was updated by user B. It should not be possible to retrieve a partially updated/corrupt DOM instance. It depends on when the requests are sent to know what version will be read. All write operations are queued on each DMA, but read operations can be done in parallel. If the update action occurred on the same DMA as the read, the read will return the updated version from the moment DataMiner gets the confirmation of the write from the DB. (Caching will make sure of this since the DB does not guarantee this availability)
Do note however that you need to take care when writing to the same DOM instance by multiple clients at once. You could overwrite changes in the following scenario:
- User A reads the DOM instance - (Value 1 = "alpha", Value 2 = "alpha")
- User B reads the DOM instance - (Value 1 = "alpha", Value 2 = "alpha")
- User B updates the DOM instance - (Value 1 = "beta", Value 2 = "alpha")
- User A updates the DOM instance - (Value 1 = "alpha", Value 2 ="beta")
Because user B updated 'Value 1' to 'beta' in between the read & update of user A, that value will be reverted again since the DOM instance of User A still contained 'alpha'. Keep this in mind when designing your DOM models/solution.
A patch API would solve this on a local DMA basis (not across the DMS), but we are evaluating whether this will be valuable enough considering it will still have drawbacks and edge cases.