EJB interview questions
- what are Container-Managed Transactional attributes ? view answer
- What's difference between httpsession and EJB session bean ? view answer
- What are the Differences between EJB 3.0 and EJB 2.1? view answer
- Q. what are Container-Managed Transactional arributes ? view answer
- What is the default transaction attribute for an EJB? view answer
- Difference between SessionBean remove() and EntityBean remove() method? view answer
- Why do we have a remove method in both EJBHome and EJBObject? view answer
- 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? view answer
- What is the difference between a ?Coarse Grained? Entity Bean and a ?Fine Grained? Entity Bean? view answer
- What are the Interfaces need to create to implement Session Bean with Exmaple? view answer
- What are the parameters must follow for Session Bean ? view answer
- What are the callbacks method in Session Bean ? view answer
- What are the ways for a client application to get an EJB object?
- What is handle and why it is used in EJB? view answer
- What is an EJB Context? view answer
- Implement Local and Remote Interfaces in EJB? view answer
- How can I call one EJB from inside of another EJB?
- What is the difference between Message Driven Beans and Stateless Session beans? view answer
- What happens if remove( ) is never invoked on a session bean? view answer
- Can you control when passivation occurs?
- Can the primary key in the entity bean be a Java primitive type such as int?
- 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?
- How can i maintain a user session between servlets and stateful session ejbs? view answer
- What's difference between Servlet/JSP session and EJB session view answer
- 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?
- How to call any EJB from a servlet/JSP/Java Client? view answer
- What are transaction isolation levels in EJB?
- What are transaction attributes?
- What is bean managed transaction?
- Can Entity Beans have no create() methods?
- What are the callback methods in Entity beans?
- What is the difference between Container-Managed Persistent (CMP) bean and Bean-Managed Persistent(BMP) ?
- What are the methods of Entity Bean?
- What is Entity Bean?
- What is Session Bean?
- What are the different kinds of enterprise beans?
!!! EJB interview questions !!!
What is Entity Bean?
The entity bean is used to represent data in the database. It provides an object-oriented interface to data that would normally be accessed by the JDBC or some other back-end API. More than that, entity beans provide a component model that allows bean developers to focus their attention on the business logic of the bean, while the container takes care of managing persistence,transactions, and access control.
There are two basic kinds of entity beans: container-managed ersistence (CMP) andbean-managed persistence (BMP).
Container-managed persistence beans are the simplest for the bean developer to create and the most difficult for the EJB server to support. This is because all the logic for synchronizing the bean's state with the database is handled automatically by the container. This means that the bean developer doesn't need to write any data access logic, while the EJB server is
supposed to take care of all the persistence needs automatically. With CMP, the container manages the persistence of the entity bean. Vendor tools are used to map the entity fields to the database and absolutely no database access code is written in the bean class.
The bean-managed persistence (BMP) enterprise bean manages synchronizing its state with the database as directed by the container. The bean uses a database API to read and write its fields to the database, but the container tells it when to do each synchronization operation and manages the transactions for the bean automatically. Bean-managed persistence gives the bean developer the flexibility to perform persistence operations that are too complicated for the container or to use a data source that is not supported by the container.