Java EJB Programming Question:

The EJB container implements the EJBHome and EJBObject classes. For every request from a unique client, does the container create a separate instance of the generated EJBHome and EJBObject classes?

Tweet Share WhatsApp

Answer:

The EJB container maintains an instance pool. The container uses these instances for the EJB Home reference irrespective of the client request. while referring the EJB Object classes the container creates a separate instance for each client request. The instance pool maintenance is up to the implementation of the container. If the container provides one, it is available otherwise it is not mandatory for the provider to implement it. Having said that, yes most of the container providers implement the pooling functionality to increase the performance of the application server. The way it is implemented is, again, up to the implementer.

Download Java EJB Programming PDF Read All 27 Java EJB Programming Questions
Previous QuestionNext Question
Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB? Can the primary key in the entity bean be a Java primitive type such as int?