File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread safety of static variables in EJB

 
Bob Runstein
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that the spec allows final static variables in EJBs. I have seen code that does this in a stateless session bean:
private final static MyHelperClass HELPER = new MyHelperClass();
This is done so that the same instance of the helper class can be used by all of the EJBs of that type.

This looks like it would not be thread safe unless MyHelperClass had no member variables or synchronized access to its member variables.
What are your thoughts on this?
Bob Runstein
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic