timmyse2 / VeganNewWorld

草食系新世界 (使用ASP.NET MVC Core2.x製作的蔬食商品展示網站)
1 stars 0 forks source link

Products 資料可由[店家]手工調整, 但若部份欄位在訂單處理時會[自動計算]增減, 可能發生衝突; #17

Open timmyse2 opened 3 months ago

timmyse2 commented 3 months ago
  1. Col: {qty, stock, on order}可能自動增減
  2. 多人使用狀況, edit頁面時的on order數值因閒置可能與其它事件的值沒有同步!!!
timmyse2 commented 3 months ago
  1. Form UI: 不讓Shop直接可改Qty等值
  2. 另用API等技術只 更改 qty, in stock, order等...
timmyse2 commented 3 months ago
  1. Add col timestamp or rowVersion or LastUpdateDateimte for 並行處理-異動衝突 (p359 <EF實務精要>)

  2. 樂觀鎖定 p148
    DB使用rowversion, model加入ETimestamp屬性 (時間戳記) public byte[] ETimestamp {get; set;}

  3. 在更新操作中,檢查 RowVersion 欄位以確保沒有其他交易在此期間修改過記錄。如果檢查失敗, 則拋出並發異常,讓使用者知道有其他人修改了這條記錄。