473,788 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controlling concurrency to access web pages by multiple users

Guys,

We have an issue where we need to control access to specific web pages e.g.
if one user is editing a purchase requisition another user shouldn't be able
to perform any actions on it.

I presume we could lock the purchase requisition for editing by a specific
user when an edit button is pressed. Only that user would then be able to
edit the document. However can anyone think of any better approaches to this
issue which I presume must be quite common in other application domains

Cheers

Matt
Oct 4 '06 #1
1 1621
Matt Adamson wrote:
Guys,

We have an issue where we need to control access to specific web
pages e.g. if one user is editing a purchase requisition another user
shouldn't be able to perform any actions on it.

I presume we could lock the purchase requisition for editing by a
specific user when an edit button is pressed. Only that user would
then be able to edit the document. However can anyone think of any
better approaches to this issue which I presume must be quite common
in other application domains
You need to think about ths requirement a little more. Pessimistic locking,
while commonplace in stateful client-server applications, is problematical
in stateless http applications. For example: user A locks a record for
editing. User B wants to edit the same record but can't until user A is
finished. What happens if user A is called away from his machine and never
comes back ... or user A's machine dies.

And what is pessimistic locking going to solve? With optimistic locking, the
last user to save his changes "wins". For example, users A and B are editing
the same record. User A finishes editing it and saves. User B then does the
same. User B's changes stick because the last update "wins". The only
difference with pessimistic locking is that the second user is notified that
someone else is editing the record before he starts editing. But even so,
the last update will "win": user A starts editing, lodking the record. User
B attempts to start and is informed that he has to wait. User A finishes
editing and unlocks the record. User B starts editing and saves his changes.
Again, the last update wins ... no diffeerence, really. The lack of
notification in optimistic locking can be mitigated by the application
keeping track of the original statem of the record when itis initially
retrieved for editing. At update time, it can first check to see if the
record has changed* since it was retrieved, and notify the user that
somebody else updated the record while he was working on it. The user can
then decide if he wants to see the changes made by the other user before
making the decision as to whether his changes should be discarded, or used
to overwrite the other user's changes. I would assume some communication
between the two users will occur since they can likely pick up a phone and
talk to each other (or walk down the hall t the other's cubicle).

If, despite my efforts to convince you otherwise, you still feel like you
need pessimistic locking, then how it is implemented really depends on the
type and version of database you are using (never ask a database-related
question without providing this information: it's almost alway relevant).
* In SQL Server, a column of type "timestamp" can be used to detect changes
to a record. The name of the datatype is misleading: it has nothing to do
with time. What it is is a unique value representing the "version" of a
record: it changes whenever an update is made to any of the columns in te
record.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Oct 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2901
by: aurora | last post by:
Hello! Just gone though an article via Slashdot titled "The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software" http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the continous CPU performance gain we've seen is finally over. And that future gain would primary be in the area of software concurrency taking advantage hyperthreading and multicore architectures. Perhaps something the Python interpreter...
1
1515
by: Seda Ozulku | last post by:
I don't have much information about .Net. May be it must be a silly question. I have Windows Application running at the server. I need to Access the program functions ( like at given time program sends mail to customer or you can manually select customer and send it ) from web. Why web? I dont want to install client applications to the all user... And Clients dont have access to server via Terminal and because of th e the Server...
4
1101
by: Jason Chu | last post by:
I have a big asp.net app that does many functions, some do alot of database cross searching, some that does upload/download from database. When two users use the application, sometimes, if one of these "big" functions are called, the second user will be able to move around some more with the smaller functions, but will reach a point when that user has to wait for the "big" function to finish first. Other times, when one big function is...
4
3599
by: =?Utf-8?B?V2lsc29uIEMuSy4gTmc=?= | last post by:
Hi Experts, I am doing a prototype of providing data access (read, write & search) through Web Service. We observed that the data storing in SQL Server 2005, the memory size is always within 250MB. Our aim is to support ~50K concurrency users. After investigation, we are thinking to use In-memory database for achieving
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.