Java Stream Question and Answers

13. What is the difference between stateful and stateless session beans?
 
    Stateful session beans:
  • A Stateful session bean is an client application.
  • It maintains conversational state when used by a client.
  • Conversational state is not written to a database; it's a state that is kept in memory while a client uses a session.
  • Maintaining conversational state allows a client to carry on a conversation with a bean.
  • Conversational state is only kept for as long as the client application is actively using the bean.
  • Stateful session bean are not sharing among clients; they are dedicated to the same client for the life of the bean.
    Stateless session beans:
  • A Stateless session bean is a collection of related services, each represented by a method; the bean maintains no conversational state from one method invocation to the next.
  • Each method is used completely independent and uses only the data passed in its parameters.
  • Stateless session beans tend to the general purpose or reusable, such as a software service.
 
Your Name Your Email-ID
Your Answer
14. How do the deployment descriptor of EJB 1.1 differ from those of EJB 1.0 version?
 
  • EJB version 1.0 uses a set of serializable classes to set and store the deployment descriptor information. Instances of these classes are created and populated with deployment information when the bean is developed, then serialized to a life.
  • The container deploying the bean de-serializes the deployment descriptor objects, and reads their properties to obtain the deployment information.
  • EJB 1.1 dropped the serializable deployment descriptor classes used in EJB 1.1 in favor of a more flexible file format based on XML (Extensible Markup Language).
  • The new XML deployment descriptors are text files structured according to the standard EJB DTD (Document Type Definition) that can be extended so that the type of deployment information stored can evolve as the specification evolves.
 
Your Name Your Email-ID
Your Answer
15. Describe the different methods in a bean class definition?
  There are three types of methods of defined in
  • Business methods
  • Bean Initialization methods
  • State management callback methods
 
Your Name Your Email-ID
Your Answer
16. Describe the Naming Service in EJB?
 
  • Naming service provides clients with a mechanism for locating distributed objects and all naming services, in general, do essentially the same thing regardless of how they are implemented.
  • A naming service must provide two things – object binding and a lookup API to accomplish its job.
  • Object binding is the association of a distributed object with a natural language name or identifier.
  • A binding is really a pointer or an index to a specific distributed object, which is necessary in an environment that manages hundreds of different distributed objects. A lookup API provides the client with an interface to the naming system.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 4 of 10