Session Beans Versus Entity Beans
By now, you already have a good concept of the difference between a session bean and an entity bean. The question now is, how do you go about using them from a client? Furthermore, do you even need both types of beans?
Typically, your clients don't access entity beans directly. Some EJB architects make this a hard and fast rule; others aren't as restrictive. The main reason you don't access entity beans directly is that you generally need to invoke several methods on an entity bean to perform an operation. This would require you to manage the transaction from the client, which is not very efficient.
Another reason you don't want to use entity beans directly is that the entity beans typically represent data objects ...
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