其實,問題是這樣的: -
我有一張桌子,說付款。我提供了幾個用於搜索,查看和編輯記錄的GUI。現在,如果用戶正在嘗試
編輯記錄
執行一些特定的操作,這需要1分鐘來處理。然後另一個用戶不應該能夠在同一記錄上執行該特定操作。什麼應該是鎖定表中記錄的正確/更好的方法?
Traditional approach of doing this is, have a column in the table, say _isLocked_. and whenever user is performing that action it should change the value of said column to, say, true. Once the process is completed it should reset the value of the column. Also, just before someone tries to perform the action, it should check the value of the column and notifies the user if the record is locked.
什麼其他的接洽在那裏做?