Using an Entity Bean from a Session Bean

Although an entity bean can use a session bean, it makes more sense for a session bean to use an entity bean. The entity bean might be shared by multiple sessions, so what session bean would an entity bean use? Would it have its own session bean? That's possible, and in situations where an entity bean does use a session bean, it's likely that the bean would have its own session. It's much more common for a session bean to use an entity bean, however.

Many developers choose not to expose the entity beans to the client at all. The client must always go through a session bean to get things done. Of course, some developers go so far as to not use entity beans at all and do all the database work in the session. ...

Get Special Edition Using Java™ 2 Enterprise Edition 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.