Hello,
I have a question about writing thread-safe Actions.
I just recently discovered that
Struts creates only one instance of the Action object for multiple sessions, and having a global variable in your Action objects makes your code not thread-safe. This was after I realized that my application was behaving quite differently when multiple users are using the application, and the pages are messed up.
So I am thinking of making some code refactoring to make the code thread-safe. The structure of my code is simple: I have a BaseAction class from which the other Action classes are extended. Here's the current code:
I already removed some of the global variables that used to be in the BaseAction class, but the application is still behaving differently in multiple sessions.
So my first question is: Is the current structure of my code not thread-safe? And, how can I refactor the code to make it thread-safe?
Thanks in advance,
Eugene