Spring has singleton and prototype. EJB has singleton and stateless.
I've been working on EJB since quite some time and I was of the opinion that singleton in EJB means multiple users cant access the class at the same time. And hence users will be kept waiting until the resource is free. Hence always used stateless.
Coming to Spring there is no equivalent of EJB stateless. Everything is singleton by default or new if used as prototype. So what happens when multiple users are trying to access the same singleton bean concurrently. Are they kept waiting?
Maybe my Java fundamentals are not clear here. What happens when multiple users try to access the same java singleton class or same method of the same java singleton class. How does it work internally? By java singleton here, I mean a class with a private constructor.
Is using Singleton and Stateless in EJB one and the same?