Record Locking

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello:

I have a question regarding Record Locking in ASP...If the user x's out of
the web page, how can I unlock the record? A co-worker told me it has to be
done in Javascript, but he doesn't know how to write the javascript and I
don't know Javascript.

The records are locked in the database simply by making a boolean field
equal to true. If the value of that field for the record you are querying
equals false, you can edit it. If it is equal to true, you will not be
allowed to run the update....So, basically, I need to run javascript code on
close that changes the value of that field to false.

Any help would be greatly appreciated. I am new at ASP.net and don't know
javascript. So, if you can give an example, that would be excellent.

Thank you,

Justin
 
Justin,

I think what you're trying to do here is dangerous. The idea is good, but
what happens with broken connections; you will locked records that will
never unlock. How do you know when to clean-up and unlock records that
shouldn't be locked?

You might want to consider a different approach and use a different locking
scheme, or possibly use optimistic concurrency which is the general to go
with disconnected data access.

Form your post I see you refer to ASP and not ASP.NET, so I'm not sure which
you're using. If ASP, you might want to consult a different newsgroup.
 
Back
Top