A
angus
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
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