Hi,
In ASP.NET website, I have a web page is used to dump raw data into
database (SQL Server). The database data will corrupt if two users
dump raw data concurrently.
How to allow only one user to access a web page at one time?
Thanks,
Ben 9 3828
I think you are looking at this all wrong. Its not the page that is the
concern its the data input. Therefore, I would implement some sort of
asynchronous input of data ( queue if you will). This way users can come and
dump data all day long at the same time but your system will only do one at a
time.
--
-Demetri
"Ben" wrote: Hi,
In ASP.NET website, I have a web page is used to dump raw data into database (SQL Server). The database data will corrupt if two users dump raw data concurrently. How to allow only one user to access a web page at one time?
Thanks, Ben
That doesn't make any sense though, SQL Server (as with all RDBMS') is
perfectly capable of inherently handling concurrent DML without
corruption. I have the feeling the problem is somewhere else (DAL
perhaps?).
Demetri wrote: I think you are looking at this all wrong. Its not the page that is the concern its the data input. Therefore, I would implement some sort of asynchronous input of data ( queue if you will). This way users can come and dump data all day long at the same time but your system will only do one at a time.
-- -Demetri
"Ben" wrote:
Hi,
In ASP.NET website, I have a web page is used to dump raw data into database (SQL Server). The database data will corrupt if two users dump raw data concurrently. How to allow only one user to access a web page at one time?
Thanks, Ben
I agree with Dimitry, but essentially all you need to do is set an
Application variable
Application["InUse"]=true while the dump operation is going and set it back
to
Application["InUse"]=false when it is done.
For all requests to the page, in the Page_Load handler,
if( Convert.ToBoolean(Application["InUse"])
Response.End();
That should pretty much cover it very simply.
Peter
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"Ben" wrote: Hi,
In ASP.NET website, I have a web page is used to dump raw data into database (SQL Server). The database data will corrupt if two users dump raw data concurrently. How to allow only one user to access a web page at one time?
Thanks, Ben
An easy solution would be to limit access to only one named user in
web.configs location tag. But to limit it to one random user - instead of
limiting access to a page, check if the SQL statement is running by setting
a simple flag in the DB and checkings its value before running the data
dump. If it is reject the request.
--
Regards
John Timney (MVP)
"Ben" <wu******@yahoo.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com... Hi,
In ASP.NET website, I have a web page is used to dump raw data into database (SQL Server). The database data will corrupt if two users dump raw data concurrently. How to allow only one user to access a web page at one time?
Thanks, Ben
Thanks for all the replies.
The raw data is in excel format. Actually, it is not just dumping.
There are a lot of deleting, updating, inserting and verifications on
database records. So it is not a single Query or stored procedure. Each
record is processed in ASP page by loop.
Ben sd********@gmail.com wrote: That doesn't make any sense though, SQL Server (as with all RDBMS') is perfectly capable of inherently handling concurrent DML without corruption. I have the feeling the problem is somewhere else (DAL perhaps?).
Demetri wrote: I think you are looking at this all wrong. Its not the page that is the concern its the data input. Therefore, I would implement some sort of asynchronous input of data ( queue if you will). This way users can come and dump data all day long at the same time but your system will only do one at a time.
-- -Demetri
"Ben" wrote:
Hi,
In ASP.NET website, I have a web page is used to dump raw data into database (SQL Server). The database data will corrupt if two users dump raw data concurrently. How to allow only one user to access a web page at one time?
Thanks, Ben
So use a transaction ...
Ben wrote: Thanks for all the replies.
The raw data is in excel format. Actually, it is not just dumping. There are a lot of deleting, updating, inserting and verifications on database records. So it is not a single Query or stored procedure. Each record is processed in ASP page by loop.
Ben
sd********@gmail.com wrote: That doesn't make any sense though, SQL Server (as with all RDBMS') is perfectly capable of inherently handling concurrent DML without corruption. I have the feeling the problem is somewhere else (DAL perhaps?).
Demetri wrote: I think you are looking at this all wrong. Its not the page that is the concern its the data input. Therefore, I would implement some sort of asynchronous input of data ( queue if you will). This way users can come and dump data all day long at the same time but your system will only do one at a time.
-- -Demetri
"Ben" wrote:
Hi,
In ASP.NET website, I have a web page is used to dump raw data into database (SQL Server). The database data will corrupt if two users dump raw data concurrently. How to allow only one user to access a web page at one time?
Thanks, Ben
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
I wouldn't want to reject the request and have the user re-submit a bunch of
times in a row until it goes through. That is not a good user experience.
Again, a queue of some sort to manage the input one at a time in an
asynchronous fashion is more sound in my eyes.
--
-Demetri
"John Timney (MVP)" wrote: An easy solution would be to limit access to only one named user in web.configs location tag. But to limit it to one random user - instead of limiting access to a page, check if the SQL statement is running by setting a simple flag in the DB and checkings its value before running the data dump. If it is reject the request. -- Regards
John Timney (MVP) "Ben" <wu******@yahoo.com> wrote in message news:11*********************@i39g2000cwa.googlegro ups.com... Hi,
In ASP.NET website, I have a web page is used to dump raw data into database (SQL Server). The database data will corrupt if two users dump raw data concurrently. How to allow only one user to access a web page at one time?
Thanks, Ben
Agreed,
but in this case our OP is probably not at that level of experience yet. To
be really efficient, you could offload the request into an MSMQ queue, and
have a separate process retrieve the items from the queue and process them
one - by - one.
Peter
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"Demetri" wrote: I wouldn't want to reject the request and have the user re-submit a bunch of times in a row until it goes through. That is not a good user experience. Again, a queue of some sort to manage the input one at a time in an asynchronous fashion is more sound in my eyes.
-- -Demetri
"John Timney (MVP)" wrote:
An easy solution would be to limit access to only one named user in web.configs location tag. But to limit it to one random user - instead of limiting access to a page, check if the SQL statement is running by setting a simple flag in the DB and checkings its value before running the data dump. If it is reject the request. -- Regards
John Timney (MVP) "Ben" <wu******@yahoo.com> wrote in message news:11*********************@i39g2000cwa.googlegro ups.com... Hi,
In ASP.NET website, I have a web page is used to dump raw data into database (SQL Server). The database data will corrupt if two users dump raw data concurrently. How to allow only one user to access a web page at one time?
Thanks, Ben
I agree with you Peter. Hence my somewhat simple suggestions.
Regards
John Timney (MVP)
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:35**********************************@microsof t.com... Agreed, but in this case our OP is probably not at that level of experience yet. To be really efficient, you could offload the request into an MSMQ queue, and have a separate process retrieve the items from the queue and process them one - by - one. Peter
-- Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com UnBlog: http://petesbloggerama.blogspot.com
"Demetri" wrote:
I wouldn't want to reject the request and have the user re-submit a bunch of times in a row until it goes through. That is not a good user experience. Again, a queue of some sort to manage the input one at a time in an asynchronous fashion is more sound in my eyes.
-- -Demetri
"John Timney (MVP)" wrote:
> An easy solution would be to limit access to only one named user in > web.configs location tag. But to limit it to one random user - instead > of > limiting access to a page, check if the SQL statement is running by > setting > a simple flag in the DB and checkings its value before running the data > dump. If it is reject the request. > -- > Regards > > John Timney (MVP) > > > > "Ben" <wu******@yahoo.com> wrote in message > news:11*********************@i39g2000cwa.googlegro ups.com... > > Hi, > > > > In ASP.NET website, I have a web page is used to dump raw data into > > database (SQL Server). The database data will corrupt if two users > > dump raw data concurrently. > > How to allow only one user to access a web page at one time? > > > > Thanks, > > Ben > > > > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Fran Tirimo |
last post by:
I am developing a small website using ASP scripts to format data retrieved
from an Access database. It will run on a Windows 2003 server supporting
FrontPage extensions 2002 hosted by the company...
|
by: Andy_Khosravi |
last post by:
I'm in a bit of a pickle.
My employer, a health insurance firm, had me design a small database to
track benefit issues. The intended users were technical specialists and
some managers (about 90...
|
by: lester |
last post by:
I'm using a C++ dll and need to allow unsafe code because the dll function takes char *. I am using Visual Studio.NET 2002. Everything I've seen says to go to the project properties page, then the...
|
by: profdotnet |
last post by:
Below is the code of web.config file:
<configuration>
<system.web>
<authentication mode="Forms" />
<authorization>
<allow users="Admin"/>
<deny users="Jack,Mary" />
<deny users="?">...
|
by: Douglas J. Badin |
last post by:
Hi,
The problem with Authorization is it stops at the first match and doesn't
permit Grouping.
On the Web Site, I am trying to Secure Page Access and SiteNaviagation by
implementing the...
|
by: =?Utf-8?B?TWFydHluIEZld3RyZWxs?= |
last post by:
From the amount of articles about this one I’m sure this gets asked a lot,
but I haven’t yet found a succinct article which explains what is required in
its entirety.
I work using Visual...
|
by: Ben Sehara |
last post by:
Is there any way I can limit the access to my website? I have a site "A" and
I want to allow access to it only from site "B" login user.
If someone try to access site "A" directory, I want it...
|
by: Octaclot |
last post by:
Hi, this is my first post, i want to allow my jsp pages to access resources but prevent a user from accessing the same files.
Example
a jsp header page loads and gets it's images from...
|
by: Cirene |
last post by:
I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm
using, webhost4life.
NOTE: I HAVE deployed other SQL Server sites to the same account with no
issues.
Now I'm getting...
|
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: 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,...
|
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,...
|
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...
| |