We have an edit form that only allows one user to edit a form at a time. The form is quite large and has quite a bit of Knockout.js code in it and this code intercepts the Submit button click to do validation, then if everything is fine it submits the form.
Nothing has changed on the server side or view side, yet just in the last few days we are having a large amount of OptimisticConcurrency errors being logged.
Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=472540 for information on understanding and handling optimistic concurrency exceptions.
The only other correlation is that some users are complaining about the site running slow. I was hoping someone may have a guess as to what is causing this? It is probably affecting less than 1% of our forms but this still causes a lot of inconvenience. It is a MVC 5 site on a load balanced server.
Aside from what may be causing this, is there some other idea of what I should do to solve the problem, like switching to a client wins concurrency exception? These are medical records so any data loss could be detrimental.
Update
From the comments, here is the code that runs when the submit button is pressed.
self.saveClick = function () {
validationTests();
if (self.validationError()) {
return false;
} else {
return true;
}
}
So that wouldn't disable the button from being pressed multiple times, would it? This may be the problem, now that the site is running slow.