An EJB container serves as the runtime environment for EJB deployed on the application server. An EJB container provides some core services such as the following:
Transactions
Instance life cycle management
Instance pooling
Security
Thread safety
There are basically three types of EJB:
Stateless Session Beans (SLSBs): SLSBs are components which don't have a conversational state. Hence, when they are not servicing a client, they are all equivalent.
Stateful Session Beans (SFSBs): SFSBs are conversational components that are tightly coupled with clients. An SFSB accomplishes a task for a particular client and maintains the state for the duration of a client session. After that, the state is not retained.
Message-driven beans (MDBs): MDBs are also components that don't hold a conversational state; however, they are able to asynchronously process messages sent by any JMS producer.
The first type of EJB we will dive deep into is the SLSB, which is typically used to provide...