Two integrations update the same Dataverse account rows. Each reads a row, applies changes and writes it back, and they have been silently overwriting each other's edits. The developer wants an SDK for .NET update to fail if the row changed after it was read. What should the developer implement?
Select an answer to reveal the explanation.
Short Explanation
Optimistic concurrency is checking the version stamp on the document before you hand in your edits. If someone else stamped it after you read it, your update bounces instead of clobbering their work. AlwaysOverwrite is the opposite: it's the very clobbering you're trying to stop.
Full Explanation
Dataverse supports optimistic concurrency for update and delete operations on tables that enable it. When a row is retrieved, its RowVersion value is returned with the entity. Sending an UpdateRequest whose Target carries that RowVersion and whose ConcurrencyBehavior is IfRowVersionMatches tells Dataverse to apply the update only if the stored version is unchanged; if another integration has modified the row since it was read, the request fails with a concurrency version mismatch fault, and the caller can re-read, merge and retry. This prevents silent lost updates without locking rows. AlwaysOverwrite explicitly disables the check, so the later write still wins and the overwrites continue. Wrapping the update in ExecuteTransactionRequest makes multiple operations atomic within one request but does not compare versions with a read that happened earlier or coordinate with another integration's requests. Retrieving the row again just before writing narrows the window but does not eliminate the race, because the other integration can still write between the second read and the update, and the logic would overwrite edits it never merged. Exam caveat: in the Web API, the same pattern uses the If-Match header with the row's ETag, and a mismatch returns 412 Precondition Failed. Operational check: read a row in two sessions, update it in one, then update it in the other with IfRowVersionMatches and confirm the second update fails.