|
 |
access_asp thread: Locking a Record
Message #1 by "Young, Ashley" <Ashley.Young@c...> on Fri, 22 Nov 2002 11:45:02 -0500
|
|
This may be slightly off topic, but I'm going to ask it anyway.
I have a web page that pulls up various records for people to verify. Many
people are running the program at once. Once the record is called up, the
person checks the record and makes any updates to it, and saves it. The
problem I'm running into is people calling up the same record at the same
time. Is there a way to lock the record so that only one can be pulled up by
one person at a time? And if the record is locked, the ASP page just pulls
up the next record that is available.
All help is greatly appreciated.
--Ashley
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
Message #2 by "Ken Schaefer" <ken@a...> on Sat, 23 Nov 2002 14:33:19 +1100
|
|
You need a collision detection strategy...
The simplest way to do this is to include a "DateModified" column in the
table(s). This stores the date/time that the record was last modified (and
could also include the userID of the person who modified it). This is
extracted with the record's data, and stored in hidden form fields. It is
posted back to the server.
When committing the data you check to see (in the WHERE clause) whether the
DateModified in the database is the same as what is posted back. If it is,
then the data hasn't been modified by someone else in the interim. If the
values are different, the someone else has modified the data, and you need
to inform the user (eg "The record you were editing has been changed. Click
here to reload the form using the current data in the database. Your changes
will be lost").
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Young, Ashley" <Ashley.Young@c...>
Subject: [access_asp] Locking a Record
: This may be slightly off topic, but I'm going to ask it anyway.
:
: I have a web page that pulls up various records for people to verify. Many
: people are running the program at once. Once the record is called up, the
: person checks the record and makes any updates to it, and saves it. The
: problem I'm running into is people calling up the same record at the same
: time. Is there a way to lock the record so that only one can be pulled up
by
: one person at a time? And if the record is locked, the ASP page just pulls
: up the next record that is available.
:
: All help is greatly appreciated.
:
: --Ashley
:
: ---
: Outgoing mail is certified Virus Free.
: Checked by AVG anti-virus system (http://www.grisoft.com).
: Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002
:
:
|
|
 |