• +91 9723535972
  • info@interviewmaterial.com

EJB Interview Questions and Answers

EJB Interview Questions and Answers

Question - 71 : - Enlist the changes in EJB 2.1 ?

Answer - 71 : -

The changes made are:

  • Message Driven Beans (MDBs): messages are accepted from other sources besides JMS.
  • EJB Query Language: New functions had been added.
  • Web services supported.
  • EJB Timer Service: Mechanism based on an event to invoke EJBs at particular times.
  • XML schema
  • Message destinations

Question - 72 : - Enlist the contents of Container. • Container contains?

Answer - 72 : -

  • Security support: Used to configure Deployment Descriptor (DD)
  • Persistence support: Used to be persistence in transactions.
  • Transaction management support: Used to configure Deployment Descriptor (DD)
  • Management of Session: Callback methods such as ejbStore (), ejbLoad () are used in the Developer.
  • Management of Life Cycle: Automatic

Question - 73 : - Differentiate ‘Stateful Session’ from ‘Entity Bean’ ?

Answer - 73 : -

While both undergo activation and passivation; EB have ejbStore () callback to save state through passivation and ejbLoad () callback to load state through activation. But in case of SS, this is not needed because S.S.B fields are serialized through objects by containers.

Question - 74 : - Which is more beneficial: Stateful or Stateless Bean?

Answer - 74 : -

If a conversational state is needed then, Stateful mode is preferred while Stateless paradigm is preferred for a single business process.

Question - 75 : - Is ejbCreate () method mandatory while defining a Session Bean?

Answer - 75 : -

EjbCreate () as being part of the bean’s lifecycle, therefore, it is not mandatory for ejbCreate () method to be present and there will be no errors returned by the compiler.

Question - 76 : - Define Context?

Answer - 76 : -

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

Question - 77 : - Define Initial Context?

Answer - 77 : -

Implementation of available methods in the interface of context such as a context called javax.meaning.InitialContext.

Question - 78 : - Define SessionContext ?

Answer - 78 : -

An EJBContext object, the SessionContext is used for accessing the information and container services.

Question - 79 : - Can EJB made to handle multiple transactions?

Answer - 79 : -

EJB can be made to handle multiple transactions by enabling multiple Entity beans to handle every database and one Session Bean to retain transaction with the Entity Bean.

Question - 80 : - How can one EJB be called from within another EJB?

Answer - 80 : -

An EJB can be called within another EJB by using JNDI which can be used for locating the Home Interface and acquiring the instance.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners