Stateful session beans are used to model business concepts that represent agents or roles that perform tasks on a client s behalf. This sharing makes stateless session instances more scalable, but also prohibits them from maintaining session data. Stateless session beans behave more like an API, where method invocations are not interdependent. Each invocation is effectively stateless and is analogous to static methods in Java classes. Stateless session beans are used to model stateless services such as credit-card processing, financial calculations, and library searches.
Entity beans are persistent, transactional, server-side components.
They are used to model persistent business-domain objects like bank accounts, orders, and products. There are two types of entity bean, distinguished by how their persistence is managed. A developer defining a BMP bean writes the database-access logic directly into the bean class. Container-managed persistence has undergone a major overhaul in EJB 2.0. They are used to model processes and routers that operate on inbound enterprise messages.