Stateless session beans are more scalable

Clients don’t share EJBObjects, but the same bean can service multiple EJBObjects. Just not at the same time. A single bean can handle multiple clients, as long as only one client at a time is in the middle of a business method invocation.

image with no caption

The bean comes out of the pool ONLY when a client invokes a business method on the EJBObject stub. So, a single bean can jump out to handle one client’s call, then jump back in the pool, then jump out to handle a different client’s call, and then jump back in the pool...

Brain Power

Why does the “pool” architecture work to make stateless session beans more scalable, but not stateful session beans? Why can’t stateful session beans use the bean pool?

Get Head First EJB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.