File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

newbie - Stateless SessionBean calling static methods

 
William Edwards
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need some advice. I have a stateless session bean that has no static methods or variables as mandated by EJB spec. However, I have plain java classes (helper classes) that have static methods. My question is : can I call these static methods (in helper java classes) from my session Bean? What about multithreading?

My belief is that once my bean method becomes live and calls static methods in my helper classes, it will never get preempted until this thread (ie, bean method) terminates. What happens when another instance of my stateless session bean becomes live too. Will this new thread interfere with the static methods of my helper class?
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There would not be any problem as long as those static methods do not access any static data which may get corrupted when multiple session instances access the static methods. Otherwise you are safe.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic