The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
Some thoughts for you to consider (based on having worked on apps that faced these issues in the past):
What would you be sending out a lock message on? When a user starts editing? Bear in mind that you are going to have a distributed environment where it is entirely possible that you would have two users looking to edit the same record about the same time - and due to latency issues, they both start the edit before they receive the lock message. How are you going to handle that?
What about the situation where someone takes out a lock but the application crashes so that they don't release the lock? What strategies are you going to put in place to handle this? There's a similar situation where the user starts an edit and then takes a phone call so that they keep this record in an editing state for a period of time?
What about if you are editing a record that is used as part of a relationship? A lookup table value for instance? Will the consuming applications need to be aware that the record may be changing?
I think you would use "traditional" locking mechanisms but use signalr only for the notification of waiting clients. So if you hit "Edit" it would say someone is editing that data and you'll then be informed automatically when the resource has become unlocked. Obviously it doesn't solve the issue of unreleased locks etc, but nothing is really going to solve that.
So if you hit "Edit" it would say someone is editing that data and you'll then be informed automatically when the resource has become unlocked
There's a latency issue, leading to a potential race condition that's the core of that problem - when two people hit edit at roughly the same time, so you get crossed notifications here. I have seen situations like this many times, so whatever solution the article is going to propose has to be able to cope with situations like that.
Not sure, but he probably works up a good thirst for some tang.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle