讓說,我有表在Azure Table中存儲Azure Table中數據一致性
public class MyTable
{
public string PK {get; set;}
public string RowPK {get; set;}
public double Amount {get; set;}
}
和消息在Azure的隊列它說添加10〜金額。
現在,讓我們說,一個工人的作用
- 從隊列中取出此消息
- 注意到,從表中的行
- 金額+ = 10
- 更新行表
- 並失敗
一段時間後消息再次在隊列中可用。所以下次工作者角色:
- 從隊列中取出此消息
- 從表中獲取行
- 金額+ = 10
- 更新行表
- 從隊列中移除消息
這些操作導致Amount += 20
而不是Amount += 10
。
我該如何避免這種情況?
似乎是一個好的事件採購的故事;你不想讓錯誤的順序延遲的消息,你會? – Henrik 2010-11-15 08:44:37