Home » Interview Questions » EJB Interview Questions » What are the different kinds of enterprise beans?
 

What are the different kinds of enterprise beans?

Session Bean: is a non-persistent object that implements some business logic running on the server. Session beans do not survive system shut down. There are two types of session beans

  • Stateless session beans (each session bean can be reused by multiple EJB clients)
  • Stateful session beans (each session bean is associated with one EJB client)

Entity Bean: is a persistent object that represents object views of the data, usually a row in a database. They
have the primary key as a unique identifier. Multiple EJB clients can share each entity bean. Entity beans can
survive system shut shutdowns. Entity beans can have two types of persistence

  • Container-managed persistence (CMP) - The container is responsible for saving the bean’s state.
  • Bean-managed persistence (BMP) – The Entity Bean is responsible for saving its own state


Message-driven Bean: is integrated with the Java Message Service (JMS) to provide the ability to act as a
message consumer and perform asynchronous processing between the server and the message producer.

 



Write a comment

  • Required fields are marked with *.

If you have trouble reading the code, click on the code itself to generate a new random code.
Security Code: