Creating a Stateless Session Bean
From a programming standpoint, it's just as easy to create a stateless session bean as it is to create a stateful one. The only real difference, other than changing a setting in the deployment tool, is in the initial design of the bean. A stateless session bean doesn't remember anything from one method invocation to the next, so any information the bean requires must be passed in from the client. Although it's true that a stateless session bean doesn't remember session-oriented data, you can store data in a stateless session bean. You just can't store client-specific data.
In the HelloWorldSession example bean, the bean had a greeting string that it remembered between method invocations. For instance, you called ...
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