Category Archives: EJB Interview Questions

What is EJB QL? | EJB Questions

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. The EJB QL query language defines … Continue reading

Posted in EJB Interview Questions | Leave a comment

What is the role of serialization in EJB? | EJB Questions

A big part of EJB is that it is a framework for underlying RMI: remote method invocation. You’re invoking methods remotely from JVM space ‘A’ on objects which are in JVM space ‘B’ — possibly running on another machine on … Continue reading

Posted in EJB Interview Questions | Leave a comment

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? | EJB Questions

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 Bean – Whenever the instance of … Continue reading

Posted in EJB Interview Questions | Leave a comment

What is clustering? What are the different algorithms used for clustering? | EJB Questions

Clustering is grouping machines together to transparantly provide enterprise services.The client does not now the difference between approaching one server or approaching a cluster of servers.Clusters provide two benefits: scalability and high availability. Further information can be found in the … Continue reading

Posted in EJB Interview Questions | Leave a comment

Can I invoke Runtime.gc() in an EJB? | EJB Questions

You shouldn’t. What will happen depends on the implementation, but the call will most likely be ignored. You should leave system level management like garbage collection for the container to deal with. After all, that’s part of the benefit of … Continue reading

Posted in EJB Interview Questions | Leave a comment

The EJB specification says that we cannot use Bean Managed Transaction in Entity Beans. Why? | EJB Questions

The short, practical answer is… because it makes your entity beans useless as a reusable component. Also, transaction management is best left to the application server – that’s what they’re there for. It’s all about atomic operations on your data. … Continue reading

Posted in EJB Interview Questions | Leave a comment

Does EJB 1.1 support mandate the support for RMI-IIOP ? What is the meaning of “the client API must support the Java RMI-IIOP programming model for portability, but the underlying protocol can be anything” ? | EJB Questions

EJB1.1 does mandate the support of RMI-IIOP. There are 2 types of implementations that an EJB Server might provide: CORBA-based EJB Servers and Proprietry EJB Servers. Both support the RMI-IIOP API but how that API is implemented is a different … Continue reading

Posted in EJB Interview Questions | Leave a comment

Does RMI-IIOP support dynamic downloading of classes? | EJB Questions

No, RMI-IIOP doesn’t support dynamic downloading of the classes as it is done with CORBA in DII (Dynamic Interface Invocation).Actually RMI-IIOP combines the usability of Java Remote Method Invocation (RMI) with the interoperability of the Internet Inter-ORB Protocol (IIOP).So in … Continue reading

Posted in EJB Interview Questions | Leave a comment

Question Can you control when passivation occurs? | EJB Questions

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 a strategy to control passivation. The … Continue reading

Posted in EJB Interview Questions | Leave a comment

Question With regard to Entity Beans, what happens if both my EJB Server and Database crash, what will happen to unsaved changes? Is there any transactional log file used? | EJB Questions

Actually, if your EJB server crashes, you will not even be able to make a connection to the server to perform a bean lookup, as the server will no longer be listening on the port for incoming JNDI lookup requests. … Continue reading

Posted in EJB Interview Questions | Leave a comment