A stateless session shared by multiple threads?

A stateless session shared by multiple threads?
http://www.theserverside.com/discussions/thread.tss?thread_id=21978

Summary for you (and me):

SLSB(StateLess Session Bean) is not accessed by more than 1 thread. Actually, you can’t get an instance of SLSB, and what you get is always a stub. And the stub always routes each method call to idle instance.

In case of SFSB(StateFul Session Bean), by definition, can’t be called simultaneously by multiple threads. If mutiple threads access SFSB, it thorws an exception.

And my opinion:

Why such a restriction is imposed on SLSB? I think SLSB will lead to 1 to 1 mapping limitation, i.e., # of maximum concurrent access = # of instances. That’s not good for performance. Somebody told me the spec. of EJB is for simplification, but I think that’s everything but a bad specification which destined JAVA to be fundamentally slow.

On the contrary, – If I remember correctly – .NET remoting provides a ‘single instance’ model. And in that model, all accesses are processed by only one instance. Hat off to .NET architects.

Similar Posts:

Post a Comment

Your email is never published nor shared.