Multiple user problems

G

Guest

Hello,
I am having a problem with multiple users using my asp.net application -
namely that if each user clicks save at the same time, some, or all, of the
users crash out.
Do I need to do anything in particular to 'queue' their requests or should
asp.net do this?
Any help would be very useful,
jsale
 
G

Guest

Please define "crash out". They must be all accessing a common resource
incorrectly. There should be an error message somewhere.
 
G

Guest

You can test whether the server is not handling load, but a few users
clicking at the same time is not normally a load problem. As such, I would
look at the application architecture (ie, the code) for a solution.

What do you mean by "crash out"? Do you mean they are getting .NET exception
messages? If so, what exception message? Or, does the app not work at all
(empty browser screen)?

There are a lot of things that could be going on. For example, if the users
are all retrieving the same data, you could get concurrency issues. That
would be normal and can be handled in your application. If concurrency is an
issue, you can rearchitect to avoid it or handle it. There are articles on
the MSDN site on concurrency handling.

What I am getting at is I am not sure what is happening in your application.
It is very hard to suggest a solution without truly understanding the
problem. Be a bit more specific about exactly what is happening.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
G

Guest

sorry, i thought i'd start as broad as possible, save giving you all the
details straight away :)
i'm using an asp.net app that is connected to a sql server database and uses
classes to hold the data retreived from the database by each user. to make
sure each user only sees their own retrieved data, i am putting the classes
into session.
eg session("XProject")
in the page load of every page that uses the classes, i am then calling from
the session
eg Xproject = session("XProject")

The errors that appear are different in many ways, for instance when more
than one user clicks save at the same time, one user may have an error trying
to move from one page to another (ie their instance of the application is
'looking' for their chosen report in other people's data). there is not a
specific error that the transaction is failing, but the fact that 4 users all
trying to write/ read at the same time all get errors has got to be more than
purely coincidental.
 
J

John Saunders

jsale said:
sorry, i thought i'd start as broad as possible, save giving you all the
details straight away :)
i'm using an asp.net app that is connected to a sql server database and
uses
classes to hold the data retreived from the database by each user. to make
sure each user only sees their own retrieved data, i am putting the
classes
into session.
eg session("XProject")
in the page load of every page that uses the classes, i am then calling
from
the session
eg Xproject = session("XProject")

The errors that appear are different in many ways, for instance when more
than one user clicks save at the same time, one user may have an error
trying
to move from one page to another (ie their instance of the application is
'looking' for their chosen report in other people's data). there is not a
specific error that the transaction is failing, but the fact that 4 users
all
trying to write/ read at the same time all get errors has got to be more
than
purely coincidental.

You're not putting classes into session, you're putting references to
objects (class instances) into session.

You still need to tell us the details. What "error" are the users seeing.
You're not giving us enough information to help you.

John Saunders
 
G

Guest

one of many errors is "argument 'index' is not a valid value", a
system.argument exception, this is because once saved, the program looks for
the data in the *instance* of the class using an index key. the index key it
is looking for cannot be found in the returned dataset because it is being
searched for in another users' instance of the classes. My app appears to be
leaking data between users, but i cannot understand how as all classes and
variables are instanced using session.
your guess is hopefully better than mine :)
 
P

Patrice

You are using likely shared (VB.NET) or static (C#) variables. They are
shared by the whole application (in ASP.NET it means all users using the
site). Do you use these kind of variables ?

Patrice

--
 
G

Guest

Thanks for your reply,
My app is built on classes that represent data retrieved from the sql server
DB. None of my variables are private, but they are not declared as 'shared'
either. I don't know if I've confused how to use session (i've never used it
before), but i am getting problems of users seeing each other's data on reads
and writes, usually between page redirects. To explain, in the page_load of
each page, i read the session into my base classes:
XProject = Session("X")
where XProject is a class with variables/ functions etc. I do this with the
classes and the connection string itself, but only write out to the session
when I initialise it. I don't think there is any need to write back to the
session each time i redirect is there? That is the only thing left i can
think of that I'm not doing!
 
A

Alejandro Penate-Diaz

Hi. Do you really need to save all those objects to a Session variable? Why
not retrieve it from database every time you need it?

Regards, Alejandro.
 
P

Patrice

And how is defined XProject ?

It should be quite easy to store an object using a similar method with a
kind of tag to make sure you identitied the problme (ie. you are actually
seeing data accross session).

This is not the normal behavior. I still beleive the more likely cause is
you are using a shared or static variables. If VB.NET are you suing modules.
Modules are actually classes with shared members....

Good luck

Patrice



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top