I would like to get advice from anyone who has come up with something like “pessimistic blocking” in an asp.net application. This is the behavior I'm looking for:
- User A opens order # 313
- User B is trying to open order No. 313, but he is informed that user A had an order opened exclusively in X minutes.
Since I have not previously implemented this functionality, I have a few design questions:
- What data should I attach to an order record? I think:
- LockOwnedBy
- LockAcquiredTime
- LockRefreshedTime
I would consider a record unlocked if LockRefreshedTime <(Now - 10 minutes).
- How can I guarantee that locks do not hold longer than necessary, but also do not expire unexpectedly?
I really like jQuery, so approaches that use a client script are welcome. This will be an internal web application, so I can be pretty liberal with bandwidth / loops. I am also wondering if “pessimistic blocking” is an appropriate term for this concept.
source
share