• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Exception when ThreadLocal.set() is called.

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
shahabas shabeer
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Master Rancher
Posts: 5122
82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That sounds, ummm, suspicious. I suggest posting the complete stack trace, along with the exact JDK version number and OS that you're using.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic