This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Multiple Stateless Beans using same static method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Multiple Stateless Beans using same static method" Watch "Multiple Stateless Beans using same static method" New topic
Author

Multiple Stateless Beans using same static method

Raj Bansilal Champaneriya
Ranch Hand

Joined: Dec 17, 2011
Posts: 36

Hello folks,

I came across a problem while working with stateless EJB. I want that a particular static method should be used in that EJB but this method is so important and it has static dependency.

As we know instances of stateless session beans are created as per requirements (one or many). So how can I be sure that all the EJB are using a single copy of that static method. I am not sure but I think every different class who use a static method will load different copy of class and then execute a different copy of the static method.

And I can't rely on singleton EJB as it not guaranty that only one copy will remain because if more than one JVM required by server. Different copy of singleton EJB will be in to existence in different JVM.

Thanks in advance.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Multiple Stateless Beans using same static method
 
Similar Threads
ejb lookups in spring config
Mystery reopen for performance: Static vs Non Static methods
Why can't I create a instance of Math class?
how to see at leat one instance of stateless session bean stays in the pool
caching local objects