Hi all,
I would like to seek help on the topic about concurrency in asp.net web
application
for instance, my application is going to implement a online restaurant table
booking system
i have a db table to store all tables in the restaurant, lets call it
res_table
in res_table, there is a table_id field, as well as a flag called
is_available, if the table has been booked, is_available=0, otherwise,
is_available=1.
normally, when a customer is going to book a table, i have to validate if
the table is_available=1. right?
now, there are two customers are going to book the same table almost the
same time,
the timeline would be as follow:
customer a -> check if < res_table xxx > is_available=1
customer b -> check if < res_table xxx > is_available=1
customer a -> book table xxx
customer b -> book table xxx
so, the data is wrong.
how to solve the problem? any good article is talking about that issue?
Thank you.
Regards,
Angus 3 1049
I think you'll have to keep track of any customer considering a booking, and
disallow any other customer from trying to check the same booking until the
first has made a decision one way or the other. You could do this with
Application-level variables.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"angus" <an***@angus.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl... Hi all,
I would like to seek help on the topic about concurrency in asp.net web application for instance, my application is going to implement a online restaurant table booking system
i have a db table to store all tables in the restaurant, lets call it res_table
in res_table, there is a table_id field, as well as a flag called is_available, if the table has been booked, is_available=0, otherwise, is_available=1.
normally, when a customer is going to book a table, i have to validate if the table is_available=1. right?
now, there are two customers are going to book the same table almost the same time,
the timeline would be as follow:
customer a -> check if < res_table xxx > is_available=1 customer b -> check if < res_table xxx > is_available=1 customer a -> book table xxx customer b -> book table xxx
so, the data is wrong.
how to solve the problem? any good article is talking about that issue?
Thank you.
Regards, Angus
One would not prefere to get locked until others decision.. It will be very
irritating for other customer if he has to wait for someone else to make
decision. and even someone can block the reservation for a long time...
What i would suggest is, to check the available flag each time you update
the record and you can through message if meanwhile someone has already
booked that seat.
"Kevin Spencer" wrote: I think you'll have to keep track of any customer considering a booking, and disallow any other customer from trying to check the same booking until the first has made a decision one way or the other. You could do this with Application-level variables.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Neither a follower nor a lender be.
"angus" <an***@angus.com> wrote in message news:OZ**************@TK2MSFTNGP09.phx.gbl... Hi all,
I would like to seek help on the topic about concurrency in asp.net web application for instance, my application is going to implement a online restaurant table booking system
i have a db table to store all tables in the restaurant, lets call it res_table
in res_table, there is a table_id field, as well as a flag called is_available, if the table has been booked, is_available=0, otherwise, is_available=1.
normally, when a customer is going to book a table, i have to validate if the table is_available=1. right?
now, there are two customers are going to book the same table almost the same time,
the timeline would be as follow:
customer a -> check if < res_table xxx > is_available=1 customer b -> check if < res_table xxx > is_available=1 customer a -> book table xxx customer b -> book table xxx
so, the data is wrong.
how to solve the problem? any good article is talking about that issue?
Thank you.
Regards, Angus
>>to check the available flag each time you update the record and you can through message
what if, after i have checked the available flag, which return true, as a
mean time, another customer booked the table, and so, the old customer will
produce a wrong record.
i know that it maybe this chance is smaller than 1/100...00, but, how can i
prevent this from happening
"i9arcanes" <i9*******@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com... One would not prefere to get locked until others decision.. It will be very irritating for other customer if he has to wait for someone else to make decision. and even someone can block the reservation for a long time... What i would suggest is, to check the available flag each time you update the record and you can through message if meanwhile someone has already booked that seat.
"Kevin Spencer" wrote:
I think you'll have to keep track of any customer considering a booking, and disallow any other customer from trying to check the same booking until the first has made a decision one way or the other. You could do this with Application-level variables.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Neither a follower nor a lender be.
"angus" <an***@angus.com> wrote in message news:OZ**************@TK2MSFTNGP09.phx.gbl... > Hi all, > > I would like to seek help on the topic about concurrency in asp.net web > application > for instance, my application is going to implement a online restaurant > table booking system > > i have a db table to store all tables in the restaurant, lets call it > res_table > > in res_table, there is a table_id field, as well as a flag called > is_available, if the table has been booked, is_available=0, otherwise, > is_available=1. > > normally, when a customer is going to book a table, i have to validate > if > the table is_available=1. right? > > now, there are two customers are going to book the same table almost > the > same time, > > the timeline would be as follow: > > customer a -> check if < res_table xxx > is_available=1 > customer b -> check if < res_table xxx > is_available=1 > customer a -> book table xxx > customer b -> book table xxx > > so, the data is wrong. > > how to solve the problem? any good article is talking about that issue? > > Thank you. > > Regards, > Angus > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
by: Charlie Williams |
last post by:
I am having difficulty performing updates and deletions
on an Access database using the Update() method of the
OleDBDataAdapter. I can insert rows without a problem,
but I get a concurrency...
|
by: Suzanne |
last post by:
Hi All
I'm having problems getting my data adapter to throw a concurrency
exception with an INSERT command. I want to throw a concurrency
exception if an attempt is made to enter a row into...
|
by: xAvailx |
last post by:
I have a requirement that requires detection of rows deleted/updated by
other processes. My business objects call stored procedures to create,
read, update, delete data in a SQL Server 2000 data...
|
by: Robert Schuldenfrei |
last post by:
Dear NG,
I was about to "improve" concurrency checking with a Timestamp when I
discovered
that my current code is not working. After about a day of beating my head
against the wall, I am...
|
by: Mike Kelly |
last post by:
I've chosen to implement the "optimistic concurrency" model in my
application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to
my main tables. I read the value of the column in my...
|
by: Bob |
last post by:
While testing my my program I came up with a consistency exception. My
program consists of three datagridviews, One called dgvPostes which is the
parent grid and its two children,one called...
|
by: William E Voorhees |
last post by:
I'm updating an Access database in a windows multi-user environment.
I'm using disconnected data
I read data from an Access Data table to a data object
I update the data object from a...
|
by: John |
last post by:
Hi
I have a vs 2003 winform data app. All the data access code has been
generated using the data adapter wizard and then pasted into the app. The
problem I have is that I am getting a data...
|
by: John |
last post by:
Hi
I have developed the following logic to handle db concurrency violations. I
just wonder if someone can tell me if it is correct or if I need a
different approach.Would love to know how pros...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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...
| |