@Stateless
public class MyBean1 {
pulic void method1() {
//method implementation
}
pulic void method2() {
//method implementation
}
}
Consider a specific instance of MyBean1. Then we know that method1() or method2() cannot be accessed by multiple threads at the same time. But, while method1() is being accessed by a thread, can method2() be accessed by another thread?
I think that secion 4.3.14 of the ejb 3.1 spec gives the answer.
As far as I understand the EJB spec you should use Singletons if you want a fine-grained control over concurrency (bean managed, container managed).