+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Java Beans (EJB) Interview Questions and Answers

Explain EJB in brief.

EJB is a standard for developing server side in JAVA. It specifies agreement between components and application servers that allows components to run on server. They are mainly for complex serer side operations like executing complex algorithm or high volume business. EJB provides the application layer logic, also called as middle tier. It provides a standard specifications-based way to develop and deploy enterprise-class system.

When was EJB developed?

EJB was developed by IBM in 1997.

What happens if remove( ) is never invoked on a session bean?

Two situations need to be taken under consideration:

Two situations need to be taken under consideration:

  • remove() invoked for a stateless session:
    In this case it may not matter whether we use remove() or not as in either case, nothing is done. The management of the number of beans in cache is done by container.
  • remove() invoked for a stateful session:
  1. the bean might be kept in cache until the session is timed out after which it is removed or
  2. when there is memory requirement, the data is cached and bean is sent to free pool.
Define Context?

This is a method of binding a name to a specific object by giving an interface like javax.naming.Context

What are the kinds of EJB's?

There are 3 kinds of EJB's - Session beans, Entity Beans, Message-driven beans

Session beans
Sessions beans represent business logic of an application. Session beans can be of 2 types namely stateless and stateful beans

Entity Beans
Entity beans represent persistent data in an EJB application.

Message-driven beans
This type of beans is used implement asynchronous communication in the system.

Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.