开发者

Preventing concurrent data modification in Web based app

I am building a web app in Silverlight which allows users to view and edit a database. In order to prevent multiple users from editing the same data, I was thinking of implementing a lock and key mechanism, so that other users are made to wait when one particular user is editing the data. Is there any way in which we can have variable(flag specifying if a user is editing data) in the server which开发者_运维知识库 can be shared across multiple clients? Is there a better way to manage this type of conurrent data access issues?


You might want to read about optimistic and pessimistic locking. For your scenario I'd go with optimistic locking, as a first try.


oracle has a SELECT FOR UPDATE syntax for pessimistic locking

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜