SQL

Comment gérer les conflits d'édition sur l'enregistrement d'une base de données ?  


The most appropriate solutions to this problem are:

  1. "lock" that record for edition whenever a user opens the page to edit it, and not let other users open it for edition. You'll need to handle what happens if a user doesn't "unlock" the record after he/she is done,
  2. notify in real time (with AJAX) the editor that the entry he/she is editing was modified, like on Stackoverflow,
  3. when a user submits an edit, check if the record was edited between when they started editing and when they tried to submit it, and show them the new version beside their version, so that they manually "merge" the 2 updates, like on Wikipedia.

Also, when subsequent requests must happen in a precise order, you need to use SQL Transactions.


Ce document a été publié le 2019-02-15 09:52:58. (Dernière mise à jour : 2019-02-27 08:21:31.)




This website uses 'cookies' to enhance user experience and provide authentification. You may change which cookies are set at any time by clicking on more info. Accept
x