I should know this, but I want to confirm with smarter people on the board.

Assume the following:
1. Servlet receives an HTTP POST request. doPost(...) is called.
2. doPost(..) instantiates class X with each request
3. Class X calls a static method of class Y

Assuming I have no synchronization in the method signature or body of Y,
there is a danger of concurrency issues or thread safety issues. Many
instances of X can call Y's static method at the same time, causing BAD
THINGS to happen.

True? I swear I used to know this but I've worked on so much stuff for this
project in the last few months it simply fell out of my brain :). I'm also
aware that the answer to this is often "it depends" but I'm looking for the
general case answer.

TIA
John

Reply via email to