I have several users, can I block a web page so that only one user at a time can update the record?

Can anyone help or provide me some suggestions for the request below.

I have a web form (meeting minutes) and 8 users who need to access this web page and update their area. A user can have more than one area for updating, and essentially I would like someone to block the web page, if possible, when the user uses it, so that no other user can refresh this web page until until joe bloggs completes.

I have an Active Directory security group configured to restrict a site to only this user group, but do I need to think about a solution to the above?

Is there a way to do this through a web control or through SQL?

+4
source share
3 answers

There must be better ways to do this. However, is it possible for you to enter a sql table column similar to "UpdateInProgress" (bit). Any update process sees this column, if 0, then it is updated to 1 and after that it saves changes and updates back to 0, so that the form is available for others to update. If the update process sees 1, it cannot update the web form because the update is in progress.

I also suggest introducing another column called "UpdateInProgressBy" to check who opened it for editing.

+2
source

First of all, we should note that from the moment the user reads the data, receives them on the page, changes them, and then tries to write them back. Thus, we are not talking about the lock command in SQL, but about any other lock that occurs in milliseconds and helps to synchronize threads, but here we need to synchronize people and what they write.

There is also a problem if the user for some reason leaves the page, and this can block the data forever.

This problem can be solved using two approaches.

simple , when the user tries to save the data, you have to check if the same data has been changed in the middle, and warn him or show the merge dialog or merge programticall or something similar - I do not know what you won.

the difficult way is to constantly monitor the page that reads and changes data, and save the results of this monitor in a common table in the database, and there, if the user has been and remains the page, other users receive warnings and read-only data until the user leaves.

This monitor should be made using javasript and should know even if the user gives up the page.

+2
source

SET THE ISOLATION LEVEL OF OPERATION as SERIALIZABLE

check out this link for more information: http://msdn.microsoft.com/en-us/library/ms173763.aspx

0
source

All Articles