tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Fiol BonnĂ­n <>
Subject Re: One user seeing another user's data
Date Mon, 23 Feb 2004 19:55:26 GMT

- Try to turn all your servlet's non-final STATIC or INSTANCE variables 
into LOCAL scope variables. This is definitely the first step, and will 
likely remove 90% of problems.

For singletons or static variables outside your servlet:

- Concentrate all your accesses to each of them in a short portion of 
code (put all accesses together). Surround them with a 
synchronized(object) { }. You will remove 80% of the remaining problems.

- If a collection is not in local scope, use a synchronized version of 
it. (??%)

For the rest, you will have to figure out   The most important point 
once the above are OK, in my opinion, is that you know the business 
logic concerning object access and its required independence. It's more 
difficult, but you probably know that better than anyone.


Antonio Fiol

Anbu wrote:

>Hello All,
>I think that this problem (one user seeing another user's data) might be due to threadedness/concurrency
of Tomcat. Ofcourse there could be problem with the JSP application too.
>Can anyone throw some light on the possible session mixups happening with Tomcat server?
I have seen the dev mailing list that such a thing happens when there are two or more tomcat
server instances.
>Thanks and Regards,

Keywords (for easier searches): threading issues, session mixup, 
concurrency problems.

View raw message