Category: EJB

The EJB container implements the EJBHome and EJBObject classes. 0

The EJB container implements the EJBHome and EJBObject classes.

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? The EJB container maintains...

What is EJB QL? 0

What is EJB QL?

EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence. EJB QL is introduced in the EJB 2.0 specification....

What is the advantage of using Entity bean for database operations, over directly using JDBC API to do database operations? When would I use one over the other? 0

What is the advantage of using Entity bean for database operations, over directly using JDBC API to do database operations? When would I use one over the other?

Entity Beans actually represents the data in a database. It is not that Entity Beans replaces JDBC API. There are two types of Entity Beans Container Managed and Bean Mananged. In Container Managed Entity...

Can you control when passivation occurs? 0

Can you control when passivation occurs?

The developer, according to the specification, cannot directly control when passivation occurs. Although for Stateful Session Beans, the container cannot passivate an instance that is inside a transaction. So using transactions can be a...

Can the primary key in the entity bean be a Java primitive type such as int? 0

Can the primary key in the entity bean be a Java primitive type such as int?

The primary key can’t be a primitive type–use the primitive wrapper classes, instead. For example, you can use java.lang.Integer as the primary key class, but not int (it has to be a class, not...

How EJB Invocation happens? 0

How EJB Invocation happens?

Step 1: Retrieve Home Object reference from Naming Service via JNDI. step 2: Return Home Object reference to the client. step 3: Create me a new EJB Object through Home Object interface. step 4:...

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? 0

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?

You can pass the HttpSession as parameter to an EJB method, only if all objects in session are serializable. This has to be consider as “passed-by-value”, that means that it’s read-only in the EJB....

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? 0

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?

The EJB container maintains an instance pool. The container uses these instances for the EJB Home reference irrespective of the client request. While refering the EJB Object classes the container creates a separate instance...

What is an EJB Context? 0

What is an EJB Context?

EJBContext is an interface that is implemented by the container, and it is also a part of the bean-container contract. Entity beans use a subclass of EJBContext called EntityContext. Session beans use a subclass...

How can I call one EJB from inside of another EJB? 0

How can I call one EJB from inside of another EJB?

EJBs can be clients of other EJBs. It just works. Use JNDI to locate the Home Interface of the other bean, then acquire an instance reference, and so forth.