Consider two processes A and B running in parallel that both want to fetch and modify record X. They are running simultaneously, and let’s assume process A fetches X first but isn’t done with it before B fetches it.
If process A does a Fetch and Lock on X, and process B does just a Fetch on X, does process B have to wait for A’s lock to be released before its Fetch happens?
– my current understanding of this situation is B does not wait - is that correct?
If process A does a Fetch and Lock on X, and process B also does a Fetch and Lock on X, does process B have to wait for A’s lock to be released before its Fetch and Lock happens?
– my current understanding of this situation is B does wait - is that correct?
I reviewed Nextworld Help for this information but didn’t really see the answer to the above
The answer is squirreled away at the very end of the first paragraph there: “Fetch locks only concern record updates”. I flagged the docs team to make this clearer but that’s meant to suggest that other Fetches are allowed to proceed even while the Fetch and Lock is in place.
and
are both correct. The latter being true because a Fetch and Lock implies an update.
If the former scenario then attempts an Update on the fetched records, it will have to wait for process A to release the lock before the Update can proceed. At that point, it may error with a “Modified By Another User” error since process A has presumably finished modifying that record and process B is now attempting an update with an old fetched version of the data that doesn’t reflect A’s changes.
So if I am understanding correctly, if there is any logic in the flow parallel or sequential that does an update with fetch records we will hit a modified error, right?
@ellen.kaufman You will get modified by another user when this sequence of events happens in this order.
Process A fetches or fetch and locks record X whose version is T1
Process B fetches record X whose version is T1
Process A modifies record X and X’s version becomes T2
Process B attempts to modify record X but is making a modification against version T1 which is out of date and has been ‘modified by another user’ to become T2 already -