Compared to stateful beans, stateless beans have a simple life
Stateless beans have a much simpler existence. They’re born (created), they’re thrown into a pool with others of their kind, they run business methods for any client who asks, and they might eventually die. They aren’t passivated, they don’t keep client-specific state, and their creation and destruction (removal) aren’t tied to the whims of the client. Compare the difference between the lifecycle of a stateful vs. stateless bean:
The bean lifecycle (special moments in a bean’s life)
Stateful session beans
Bean creation (when the client wants a bean)
Bean use (when the client calls a business method)
Bean passivation (the bean is put to sleep to conserve resources)
Bean activation (the bean wakes up to service a business method from the client)
Bean removal (when the client is finished with the bean or the bean times out)
Stateless session beans
Bean creation (when the container wants to make a bean)
Bean use (when the client calls a business method)
Bean removal (when the container decides there are too many beans in the pool, or the bean throws a system exception.)
Comparing the lifecycles of stateful and stateless session beans
Stateful

Stateless

Client calls create on a stateless session bean home
Client calls create on the home.
Container ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access