By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,067 Members | 1,818 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,067 IT Pros & Developers. It's quick & easy.

Session data getting corrupted.

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
sh*************@db.com (Shiv) wrote in message news:<68*************************@posting.google.c om>...
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


As a quick idea, I suspect that your HttpSession objects and/or
request related data are not synchronized, or, your servlet implements
SingleThreadModel ...
Jul 17 '05 #2

P: n/a
sh*************@db.com (Shiv) wrote in message news:<68*************************@posting.google.c om>...
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


As a quick idea, I suspect that your HttpSession objects and/or
request related data are not synchronized, or, your servlet implements
SingleThreadModel ...
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.