From: Nikolaos P. <nk...@cc...> - 2006-02-18 08:50:41
|
Hi all, I am using webmacro to develop a web-based application. Things seemed to work fine till yesterday. A customer complained that he=20 managed to =93see=94 the account of another customer when he logged-in us= ing=20 his own credentials (he send me a screen shot of the =93view=94). By inspecting the log file I found that both users have been logged-in=20 at the same time (the second customer logged in 3 sec after the first=20 customer). The system has more than 1000 customers but this inconvenience happened=20 for the first time yesterday (?). It seems that different sessions have been mixed up. The servlet includes a handle method and uses several other methods=20 (methods that write and read from a database). All methods are defined in the same class (that extends WMServlet). As far as I know servlets must not have instance variables (only local=20 variables -inside methods- to prevent data corruption and=20 inconsistencies). However in my servlet I use only one non local=20 variable (a Logger) and I don't think this is the cause of the problem. As an attached file I send you a fragment of the before mentioned servlet. Can instance variables be defined in the case of a servlet that extends=20 WMServlet? (I mean is it safe? or its not a good practice without=20 keeping precautions?) Do you have any idea what can have caused this inconvenience ? Is the use of methods inside the servlet thread-safe ? Please help!!! Nikolaos Papadakis |