Session data getting corrupted.

From: Shiv (shivram.vempaty_at_db.com)
Date: 01/25/04


Date: 25 Jan 2004 07:02:42 -0800

I have a servlet driven web application using ServletExec 4.2 AS, IIS
4.0 as the platform. Some user data is stored is persisted in a user
object at the beginning of the session which includes use rid, client id
etc.

There have been intermittent problems with the application, when for a
split second, one user suddenly gets somebody elses data like name
etc. As soon as the user refreshes the page the problem goes away.

Initially we concluded that the sessions may be getting swapped,
however on debugging we found that no such thing is happening and the
session ids never get crossed. Our other approach was not to store
anything in the user object associated with each session, rather get
such information every time from data base(this may have a performance
impact).

Is it true that when a servlet is called the first time, the same
instance services all other requests for the servlet?? i.e. at any
given time there is one and only one instance of certain servlet
running in the servlet container
If the above is true, is it possible that the same servlet instance is
swapping data from the user objects associated with different
sessions??.
How does the servlet resolve the context in a single threaded model??

Can anybody shed light on any similar experience and possible
resolutions of the same..

Shiv



Relevant Pages

  • Re: pls help w/cookies.......
    ... into a session object in the server side). ... the output of the handler servlet contains a link to a viewer ...
    (comp.lang.java.help)
  • Re: How to re-use existing classes in JSP/JavaBeans/Servlets
    ... I want to instantiate them and have the instance ... so the lifecycle is that of the client session. ... Process all data that comes in a HTTP request within a servlet -- they're ... are a good match with JSPs, and JSPs are good for creating HTML views. ...
    (comp.lang.java.programmer)
  • Re: Servlet design question
    ... don't put huge objects in the session, ... Concerning fields in the servlet class itself, no, you shouldn't do it, ... > for that request only (e.g. request-related stuff scooped out of ... > wrapper also contains a reference to my SessionState object, ...
    (comp.lang.java.programmer)
  • Re: TOMCAT PROBLEM: Establishing a session
    ... > I have a java applet running inside the html produced by the java ... > servlet, we have written a second servlet which implements a HashTable ... Do note that where sessions are maintained via a session cookie, ... You must also take care when trying to pass request parameters ...
    (comp.lang.java.programmer)
  • Re: Share a Session
    ... >> You could write the sessionID into the applet tag as a parameter. ... > How exactly do I use the session id from the applet? ... same name that the servlet normally uses which is "JSESSIONID" ... will let you set a cookie header - I don't remember the exact ...
    (comp.lang.java.help)