Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Locking Records

Author  Topic 

Billkamm
Posting Yak Master

124 Posts

Posted - 2006-01-19 : 11:14:35
I'm creating an online application website that will be used by several end users. My problem is if someone is in the application to edit the fields I obviously don't want someone else in the same application. I'm looking for the best way to lock the other users out. Because of the way HTTP works I cannot guarentee I will know when they have closed their web browser.

My thoughts were the following (please let me know if you have any better ideas):


  • Create a column in the applications table called "locked by"

  • This will be NULL if it is not locked or a key to the users table if it is locked by someone.

  • When the page loads it will lock the app to them

  • When they leave the page it will release the lock

  • When their session times out it will release the lock

  • When the login or logout all existing locks for them are released



Does anyone know of any built-in way of locking records for something like this or have any suggestions on my idea?
   

- Advertisement -