Hi frienz,
We have developed a web application in JSP and tested it in Apache Tomcat 4.0.6. It works absolutely normal when single user accesses the system. We get problems when multiple users (say 17 users simultaneously) access the system. When a user tries to view his data, it shows the information of some other user. Can anybody tell me what could have gone wrong?
Thanx in advance,
Karan
-
Concurrency issue in jsp application (5 messages)
- Posted by: karan P
- Posted on: September 15 2003 01:21 EDT
Threaded Messages (5)
- Concurrency issue in jsp application by David Rabinowitz on September 15 2003 05:34 EDT
- Concurrency issue in jsp application by Alexey Titorenko on September 15 2003 10:15 EDT
- Concurrency issue in jsp application by Ian Mitchell on September 15 2003 11:38 EDT
- not using Application scope variables/objects by karan P on September 16 2003 03:08 EDT
- Two common problems by Jonas Andersen on September 16 2003 02:40 EDT
-
Concurrency issue in jsp application[ Go to top ]
- Posted by: David Rabinowitz
- Posted on: September 15 2003 05:34 EDT
- in response to karan P
It's hard to tell from that little information, but I'd guess you keep the user data in some central place, instead of user specific location (like the session). -
Concurrency issue in jsp application[ Go to top ]
- Posted by: Alexey Titorenko
- Posted on: September 15 2003 10:15 EDT
- in response to karan P
Hi.
You should also check if your application carefully uses 'application' scope. -
Concurrency issue in jsp application[ Go to top ]
- Posted by: Ian Mitchell
- Posted on: September 15 2003 11:38 EDT
- in response to Alexey Titorenko
<pre>
Not sure where you are storing client data - it should be in the client session.
For debugging purposes you also might want to make the JSP single threaded, i.e.:
<%@ page isThreadSafe="false" %>
This should at least tell you if a lack of thread safety is responsible for the issue you are seeing.
</pre> -
not using Application scope variables/objects[ Go to top ]
- Posted by: karan P
- Posted on: September 16 2003 03:08 EDT
- in response to Alexey Titorenko
Hi
Thanks for ur response. But we haven't used Application scope variables/objects... -
Two common problems[ Go to top ]
- Posted by: Jonas Andersen
- Posted on: September 16 2003 02:40 EDT
- in response to karan P
I see two common problems, which may lead to this situation:
1. lack of understanding of the servlet/jsp programming model. This especially includes the servlet lifecycle and the attribute scopes. Make sure that your developers understand the differences between application, session and request scope for attributes. Also any use of servlet instance variables should be cause for alarm and if they are modified during a request there should be red lights and sirens going off!
2. Improper use of singletons. The singleton pattern is easy to understand and implement, but often difficult to get working correctly in a J2EE environment. If you use singletons, make sure you have extensive knowledge on the classloaders used in your application server!
Just my 0.2 Dkr.
/jonas