There exists two types of synchronisation techniques to make sure you avoid concurrency issues and race conditions when updating database records. These are as follows.

  • Optimistic locking
  • Pessimistic locking

Optimistic locking is usually performed by using native database mechanism such as RowVersion in SQL Server, TimeStamp in MySQL, or ETag in Cosmos DB. These are special field types that changes automatically as the record is updated, allowing you to inject the values of these fields as a criteria to your update invocations. For an example of how this works, imagine the following schema.

Source de l’article sur DZONE

L’assistance proposée par ANKAA PMO

ANKAA PMO présent depuis plus de 20 ans sur le marché des services IT, accompagne les DSI dans leur recherche de compétences pour des besoins de renforts en mode régie ou l’externalisation de projets.
Vous souhaitez plus d’information ? Cliquez ici