User sessions swapped

We are using 6.1 SP7. We have a servlet/jsp application that does a database search and stores the results as a vector in to the user's session. When the user clicks on the next page in the application the results are pulled from the session and the requested page is displayed.

The problem we are seeing is User A is getting a page from User B's search results. This only happens intermittently.

We are using the StandardManager so I plan to try using the PersistantManager, but I was wondering if someone has an explanation. Looks like StandardManager saves session in memory so could we be having a memory issue? There are no errors reported in the errors log.

Thanks for any assistance.

[717 byte] By [safsadfasfa] at [2007-11-27 8:34:22]
# 1
Could you provide an small sample app where this can be reproduced?
nseguraa at 2007-7-12 20:30:36 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

Hi nsegura. This is a secure intranet app so I can't really do that. I have switched over to PersistentManager so we'll see if this cures the problem.

Have you run into this by chance? It could be related to the amount of data we are putting into the session. It is often 10,000 or more records at a time.

Thanks!

pflickjavaa at 2007-7-12 20:30:36 > top of Java-index,Web & Directory Servers,Web Servers...
# 3

Have you eliminated the possibility of the bug being in the code that puts data into the user's session?

If possible please could you tell us how the following problem manifests itself?

"The problem we are seeing is User A is getting a page from User B's search results"

you mentioned that you store 1000s of records in the user's session. does a jsp display the search results? if so, is it just one of the results that is a problem or is it that all of user a's results are now from a search that user b did? does the JSP display any other data from the session? Is this data also for the wrong user?

Arvind_Srinivasana at 2007-7-12 20:30:36 > top of Java-index,Web & Directory Servers,Web Servers...
# 4

> Have you eliminated the possibility of the bug being

> in the code that puts data into the user's session?

>

It could be a bug but I don't see anything obvious in the code. Also the problem is intermittent and not easily reproduced.

> If possible please could you tell us how the

> following problem manifests itself?

> "The problem we are seeing is User A is getting a

> page from User B's search results"

>

> you mentioned that you store 1000s of records in the

> user's session. does a jsp display the search

> results? if so, is it just one of the results that is

> a problem or is it that all of user a's results are

> now from a search that user b did? does the JSP

> display any other data from the session? Is this data

> also for the wrong user

Yes, the jsp displays a page of the search results results, 50 records per page. User A will see a full page of User B's results. No other data from the session is displayed

pflickjavaa at 2007-7-12 20:30:36 > top of Java-index,Web & Directory Servers,Web Servers...
# 5

To answer your question, I have not run into this, not heard of anything similar.

I understand that you dont want to provide access to you setup or application.

However, if you could provide a sample snip of code, that does something similar to what your app is doing, i.e. handles connection, puts the records in memory and displays them in the same way your app does it, maybe it can shed some clues on what can be wrong.

nseguraa at 2007-7-12 20:30:36 > top of Java-index,Web & Directory Servers,Web Servers...
# 6

> To answer your question, I have not run into this,

> not heard of anything similar.

>

> I understand that you dont want to provide access to

> you setup or application.

> However, if you could provide a sample snip of code,

> that does something similar to what your app is

> doing, i.e. handles connection, puts the records in

> memory and displays them in the same way your app

> does it, maybe it can shed some clues on what can be

> wrong.

I think we've figured out the issue. The vector storing the results was defined as an instance variable on the servlet rather than a local variable in the service method. Testing now, but so far so good. Thanks to all who offered suggestions.

pflickjavaa at 2007-7-12 20:30:37 > top of Java-index,Web & Directory Servers,Web Servers...