473,395 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to allow only one user to access a web page at one time?

Ben
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

Jun 7 '06 #1
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

Jun 7 '06 #2
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


Jun 7 '06 #3
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

Jun 7 '06 #4
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

Jun 7 '06 #5
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


Jun 7 '06 #6
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.
Jun 7 '06 #7
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


Jun 7 '06 #8
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


Jun 7 '06 #9
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
> >
>
>
>

Jun 8 '06 #10

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

Similar topics

2
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...
16
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...
1
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...
5
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="?">...
0
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...
5
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...
16
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...
1
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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,...
0
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,...
0
jinu1996
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...
0
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 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.