| Author |
Exception when ThreadLocal.set() is called.
|
shahabas shabeer
Ranch Hand
Joined: Feb 23, 2004
Posts: 49
|
|
Hi, My application throws a java.lang.Exception when it call ThreadLocal.set() method. This happens only during load test with 1000 concurrent virtual users. I never got this error during development and could not reproduce in my development machine. So I guess the issue is with thread management. Should I call this method in a thread safe manner?. What would happen if I did not synchronize the method?. Will the application throw java.lang.Exception if two threads try to update this value at the same time? Any help would be highly appreciated. Thanks
|
The greatest pleasure in life is doing what peoples say you can not do.
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24054
|
|
|
Is there no message associated with the exception? If not, are you sure that your code isn't swallowing and re-throwing a more informative exception?
|
[Jess in Action][AskingGoodQuestions]
|
 |
shahabas shabeer
Ranch Hand
Joined: Feb 23, 2004
Posts: 49
|
|
|
Nope.. There is no clear message in the exception. I do have a try-catch block but I am printing the entire exception details using printStackTrace() method.
|
 |
Mike Simmons
Ranch Hand
Joined: Mar 05, 2008
Posts: 2778
|
|
|
That sounds, ummm, suspicious. I suggest posting the complete stack trace, along with the exact JDK version number and OS that you're using.
|
 |
 |
|
|
subject: Exception when ThreadLocal.set() is called.
|
|
|