US 12,314,241 B1
System, method, and computer program for optimistic concurrency control mechanism with automatic content merge
Lucas Dario Majerowicz, Herzlyia (IL)
Assigned to AMDOCS DEVELOPMENT LIMITED, Limassol (CY)
Filed by Amdocs Development Limited, Limassol (CY)
Filed on Jun. 28, 2023, as Appl. No. 18/215,708.
Int. Cl. G06F 16/23 (2019.01); G06F 16/242 (2019.01)
CPC G06F 16/2329 (2019.01) [G06F 16/244 (2019.01)] 6 Claims
OG exemplary drawing
 
1. A non-transitory computer-readable media storing computer instructions which when executed by one or more processors of a device cause the device to:
fetch, by a first source, the initial version of a resource from a memory for updating;
fetch, by a second source, the initial version of the resource from the memory for updating;
perform, by the first source, a first update on the initial version of the resource in the memory to a form a new version of the resource in the memory, wherein the first update by the first source is performed after the second source fetches the initial version of the resource from the memory and before the second source performs a second update on the initial version of the resource in the memory;
store the new version of the resource in the memory with an indicator of the new version along with the initial version of the resource being stored in the memory with the indicator of the initial version;
request, by the second source, to perform the second update on the initial version of the resource in the memory;
detect a concurrency error by determining that the second update requested by the second source references the initial version of the resource which does not match the new version indicated in the memory for the new version of the resource stored in the memory;
responsive to detecting the concurrency error and that the first update and the second update do not modify a same field of the initial version of the resource, merge the first update and the second update to form a merged update, wherein the merge is a three-way merge that uses use a first content of the first update, a second content of the second update, and a base content of the initial version of the resource to form the merged update; and
overwrite the new version of the resource stored in the memory with the merged update applied to the initial version of the resource in the memory.