Types of Enterprise JavaBeans

Session beans and entity beans are the two basic types of Enterprise JavaBeans. In a distributed EJB application, these two types of beans play different roles.

A session beanis an EJB instance associated with a single client. Usually session beans are not persistent—although they have the potential to be persistent—and they may or may not take part in transactions. Session objects, in particular, do not generally survive server crashes. A session object might be, for example, an EJB living inside a Web server that serves HTML pages to a user on a browser and tracks that user's path through the site. The session object will be destroyed after a specified idle time or when the user leaves the site. Although the session ...

Get JavaBeans Unleashed 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.