Stateless session beans

A stateless session bean does not hold any state information for the client. Therefore, one session bean can be shared across multiple clients. The EJB container maintains pools of stateless beans, and when a client request comes, it takes a bean out of the pool, executes methods, and returns the bean to the pool again. Stateless session beans provide excellent scalability because they can be shared and they need not be created for each client.

We use the @Stateless annotation on the class to mark it as a stateless session bean.

Get Java EE 8 Development with Eclipse 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.