1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

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? view answer
  • 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? view answer
  • 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? view answer
  • Can the primary key in the entity bean be a Java primitive type such as int? view answer
  • 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? view answer
  • 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? view answer
  • How to call any EJB from a servlet/JSP/Java Client? view answer
  • What are transaction isolation levels in EJB? view answer
  • What are transaction attributes? view answer
  • What is bean managed transaction? view answer
  • Can Entity Beans have no create() methods? view answer
  • What are the callback methods in Entity beans? view answer
  • What is the difference between Container-Managed Persistent (CMP) bean and Bean-Managed Persistent(BMP) ? view answer
  • What are the methods of Entity Bean? view answer
  • What is Entity Bean? view answer
  • What is Session Bean? view answer
  • What are the different kinds of enterprise beans? view answer

!!! EJB interview questions !!!

What are the methods of Entity Bean?



An entity bean consists of 4 groups of methods:

1. create methods: To create a new instance of a CMP entity bean, and therefore insert data into the database, the create() method on the bean's home interface must be invoked. They look like this: EntityBeanClass ejbCreateXXX(parameters), where EntityBeanClass is an Entity Bean you are trying to instantiate, ejbCreateXXX(parameters) methods are used for creating Entity Bean instances according to the parameters specified and to some programmer-defined conditions.

A bean's home interface may declare zero or more create() methods, each of which must have corresponding ejbCreate() and ejbPostCreate() methods in the bean class. These creation methods are linked at run time, so that when a create() method is invoked on the home interface, the container delegates the invocation to the corresponding ejbCreate() and ejbPostCreate() methods on the bean class.

2. finder methods: The methods in the home interface that begin with "find" are called the find methods. These are used to query the EJB server for specific entity beans, based on the name of the method and arguments passed. Unfortunately, there is no standard query language defined for find methods, so each vendor will implement the find method differently. In CMP entity beans, the find methods are not implemented with matching methods in the bean class; containers implement them when the bean is deployed in a vendor specific manner. The deployer will use vendor specific tools to tell the container how a particular find method should behave. Some vendors will use object-relational mapping tools to define the behavior of a find method while others will simply require the deployer to enter the appropriate SQL command.

There are two basic kinds of find methods: single-entity and multi-entity. Single-entity find methods return a remote reference to the one specific entity bean that matches the find request. If no entity beans are found, the method throws an ObjectNotFoundException . Every entity bean must define the single-entity find method with the method name findByPrimaryKey(), which takes the bean's primary key type as an argument.

The multi-entity find methods return a collection ( Enumeration or Collection type) of entities that match the find request. If no entities are found, the multi-entity find returns an empty collection.

3. remove methods: These methods (you may have up to 2 remove methods, or don't have them at all) allow the client to physically remove Entity beans by specifying either Handle or a Primary Key for the Entity Bean.

4. home methods: These methods are designed and implemented by a developer, and EJB specification doesn't have any requirements for them except the need to throw a RemoteException is each home method.

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy