Question 1. What Is The Difference Between Ejb And Java Beans?
EJB is a specification for J2EE server, not a product.
Java beans may be a graphical component in IDE.
Question 2. What Is Ejb Role In J2ee?
EJB technology is the core of J2EE. It enables developers to write reusable and portable server-side business logic for the J2EE platform.
Question 3. What Is Enterprise Javabeans (ejb) Container?
1.It manages the execution of enterprise beans for J2EE applications.
2.Enterprise beans and their container run on the J2EE server.
Question 4. What Is In-memory Replication?
The process by which the contents in the memory of one physical m/c are replicated in all the m/c in the cluster is called in-memory replication.
Question 5. What Is Ripple Effect?
The process of propagating the changes in the properties of a server group during runtime to all the associated clones is called Ripple Effect.
Question 6. What Is A Clone?
The copies of a server group are called Clones. But unlike a Server Group Clones are associated with a node and are real server process running in that node.
Question 7. What Are The Types Of Scaling?
There are two types of scaling: Vertical Scaling and Horizontal Scaling.
Vertical Scaling – When multiple server clones of an application server are defined on the same physical m/c, it is called Vertical Scaling. The objective is to use the processing power of that m/c more efficiently.
Horizontal Scaling – When Clones of an application server are defined on multiple physical m/c, it is called Horizontal Scaling. The objective is to use more than one less powerful m/c more efficiently.
Question 8. What Is A Server Group?
A server group is a template of an Application Server(and its contents) i.e, it is a logical representation of the application server. It has the same structure and attributes as the real Application Server, but it is not associated with any node, and does not correspond to any real server process running on any node.
Question 9. What Is The New Basic Requirement For A Cmp Entity Bean Class In 2.0 From That Of Ejb 1.1?
It must be abstract class. The container extends it and implements methods which are required for managing the relationships
Question 10. What’s New In The Ejb 2.0 Specification?
Following are some of the main features supported in EJB 2.0:
1. Integration of EJB with JMS.
2. Message Driven Beans.
3. Implement additional Business methods in Home interface which are not specific for bean instance, EJB QL.
Question 11. How Can I Access Ejb From Asp?
We can use the Java 2 Platform, Enterprise Edition Client Access Services (J2EETM CAS) COM Bridge 1.0, currently downloadable from Sun
Question 12. What Is The Relationship Between Local Interfaces And Container-managed Relationships?
Entity beans that have container-managed relationships with other entity beans, must be accessed in the same local scope as those related beans, and therefore typically provide a local client view. In order to be the target of a container-managed relationship, an entity bean with container-managed persistence must provide a local interface.
Question 13. What Is Ejbdoclet?
EJBDoclet is an open source JavaDoc doclet that generates a lot of the EJB related source files from custom JavaDoc comments tags embedded in the EJB source file.
Question 14. What Is The Difference Between Session And Entity Beans?
An entity bean represents persistent global data from the database; a session bean represents transient user-specific data that will die when the user disconnects (ends his session). Generally, the session beans implement business methods (e.g. Bank.transferFunds) that call entity beans (e.g. Account.deposit, Account.withdraw)
Question 15. Is It Legal To Have Static Initializer Blocks In Ejb?
Although technically it is legal, static initializer blocks are used to execute some piece of code before executing any constructor or method while instantiating a class. Static initializer blocks are also typically used to initialize static fields – which may be illegal in EJB if they are read/write – In EJB this can be achieved by including the code in either the ejbCreate(), setSessionContext() or setEntityContext() methods
Question 16. What Are Transaction Isolation Levels In Ejb?
1. Transaction_read_uncommitted- Allows a method to read uncommitted data from a DB(fast but not wise).
2. Transaction_read_committed- Guarantees that the data you are getting has been committed.
3. Transaction_repeatable_read – Guarantees that all reads of the database will be the same during the transaction (good for read and update operations).
4. Transaction_serializable- All the transactions for resource are performed serial.
Question 17. Can Entity Beans Have No Create() Methods?
Yes. In some cases the data is inserted NOT using Java application, so you may only need to retrieve the information, perform its processing, but not create your own information of this kind.
Question 18. What Is Software Architecture Of Ejb?
Session and Entity EJBs consist of 4 and 5 parts respetively:
1. A remote interface (a client interacts with it).
2. A home interface (used for creating objects and for declaring business methods).
3. A bean object (an object, which actually performs business logic and EJB-specific operations).
4. A deployment descriptor (an XML file containing all information required for maintaining the EJB) or a set of deployment descriptors (if you are using some container-specific features).
5.A Primary Key class – is only Entity bean specific.
Question 19. What Is Ejb Ql?
1.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.
2.EJB QL is introduced in the EJB 2.0 specification.
3.The EJB QL query language defines finder methods for entity beans with container managed persistence and is portable across containers and persistence managers.
4.EJB QL is used for queries of two types of finder methods:
Finder methods that are defined in the home interface of an entity bean and which return entity objects.Select methods, which are not exposed to the client, but which are used by the Bean Provider to select persistent values that are maintained by the Persistence Manager or to select entity objects that are related to the entity bean on which the query is defined.
Question 20. How Ejb Invocation Happens?
1: Retrieve Home Object reference from Naming Service via JNDI.
2: Return Home Object reference to the client.
3: Create me a new EJB Object through Home Object interface.
4: Create EJB Object from the Ejb Object
5: Return EJB Object reference to the client.
6: Invoke business method using EJB Object reference.
7: Delegate request to Bean (Enterprise Bean).
Question 21. What Are The Call Back Methods In Entity Bean?
Callback methods allows the container to notify the bean of events in its life cycle. The callback methods are defined in the javax.ejb.EntityBean interface.
Question 22. What Is Message Driven Bean?
1.An MDB is essentially a message consumer that can listen to a message destination or a message endpoint and gets activated when a message arrives.
2.By design, MDBs are anonymous in nature and hence cannot be directly invoked by a client.
3.The only way to invoke an MDB is to send a message to the destination or endpoint to which it is listening.
4. As MDBs are stateless in nature and are not related to any specific client, they can be pooled for concurrent processing of messages.
Question 23. What Are The Services Provided By Container?
Container services are totally depends upon the “vendor implementation”. But more or less most of the vendors suppots the basic services like,
LifeCycle Management – It is Automatic.
Session Management – it is used by Developer coded callback methods…
Transaction Management – it is used by configuring deployment descriptor (DD) .
Security management – it is used by configuring deployment descriptor (DD) .
The other services, if any will be in advanced versions, and depends on Vendor specific.
Question 24. What Is Deployment Descriptor?
Deployment descriptor is a XML file. which is used to locate the web applicatio n by container.it includes the details of respective bean.
Question 25. How Many Ejb Objects Are Created For A Bean?
For a Session bean – one EJB object for one bean instance.
For entity bean – it depends , if 2 users are accessing one row at time then one EJB object is used for both the beans other wise for each bean one EJB object.
Question 26. What Is Re-entrant. Is Session Beans Reentrant. Is Entity Beans Reentrant?
If we define the entity bean as being reentrant, multiple clients can connect to the Entity bean & execute methods within the entity bean concurrently. Container takes care of synchronization. If we define the entity bean as non-reentrant and many clients connect to it concurrently to execute a method, exception is thrown .
Question 27. What Is Ejb Client Jar File?
An EJB client JAR file is an optional JAR file that can contain all the class files that a client program needs to use the client view of the enterprise beans that are contained in the EJB JAR file. If you decide not to create a client JAR file for an EJB module, all of the client interface classes will be in the EJB JAR file.
Question 28. What Is Ejb Container?
An EJB container is a run-time environment that manages one or more enterprise beans. The EJB container manages the life cycles of enterprise bean objects, coordinates distributed transactions, and implements object security. Generally, each EJB container is provided by an EJB server and contains a set of enterprise beans that run on the server.
Question 29. What Is Remote Client View?
1.The remote client view specification is only available in EJB 2.0.
2. The remote client view of an enterprise bean is location independent.
3.A client running in the same JVM as a bean instance uses the same API to access the bean as a client running in a different JVM on the same or different machine.
Remote interface: The remote interface specifies the remote business methods that a client can call on an enterprise bean.
Remote home interface: The remote home interface specifies the methods used by remote clients for locating, creating, and removing instances of enterprise bean classes.
Question 30. What Is Local Client View?
1.The local client view specification is only available in EJB 2.0. Unlike the remote client view, the local client view of a bean is location dependent.
2.Local client view access to an enterprise bean requires both the local client and the enterprise bean that provides the local client view to be in the same JVM.
3.The local client view therefore does not provide the location transparency provided by the remote client view. Local interfaces and local home interfaces provide support for lightweight access from enterprise bean that are local clients.
4.Session and entity beans can be tightly couple with their clients, allowing access without the overhead typically associated with remote method calls.
J2EE Interview Questions
Core Java Interview Questions
Core Java Tutorial
JDBC Interview Questions
JSP Interview Questions
Android Interview Questions
J2EE Interview Questions
JMS(Java Message Service) Interview Questions
JavaServer Faces (JSF) Interview Questions
Core Java Interview Questions
JavaServer Faces (JSF) Tutorial
Java collections framework Interview Questions
Java 8 Tutorial
Java 8 Interview Questions
JDBC Interview Questions
JAVA Persistence API (JPA) Tutorial
Java Collections Interview Questions
JSP Interview Questions
Java Exception Handling Interview Questions