Services provided to EJB components by EJB container - EJB

Q.  Which services are provided to EJB components by the EJB container?

- Published on 19 Oct 15

a. Transaction support
b. Persistence support
c. Naming support
d. All mentioned above

ANSWER: All mentioned above
 

    Discussion

  • Nirja Shah   -Posted on 14 Dec 15
    - The EJB container provides services to EJB components.
    - The services included are as follows:

    Transaction support
    - Transactions are supported by an EJB container.
    - EJB specifications provide an approach to transaction management called declarative transaction management.
    - In declarative transaction management, specification for the type of transaction support required by your EJB component.
    - The necessary transaction support is provided by the container when the bean is deployed.

    Persistence support
    - An EJB container provides support for persistence of EJB components.
    - An EJB component is said to be persistent if it is capable of saving and retrieving its state.
    - A persistent EJB component saves its state to some type of persistent storage (usually a file or a database).
    - EJB component does not have to be re-created with each use with persistence.
    - An EJB component can manage its own persistence (by means of the logic you provide in the bean) or delegate persistence services to the EJB container.
    - Container-managed persistence means that the data appears as member data and the container performs all data retrieval and storage operations for the EJB component.

    Naming support
    - An EJB container must provide an implementation of Java Naming and Directory Interface (JNDI) API to provide naming services for EJB clients and components. Naming services provide:

    a. Location transparency Clients can instantiate components by name, and do not need to know the details about the server hosting the component.

    b. Deployment flexibility Beginning in EJB version 1.1, EJB components can be configured with naming aliases for components and resources such as databases, JavaMail sessions, and JMS message queues.

    c. Using aliases simplifies the procedure to deploy the component on a server where the accessed components and resources use different JNDI names.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)