aspose file tools*
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
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.
 
 
subject: Multiple Stateless Beans using same static method