nerdexam
Oracle

1Z0-895 · Question #94

A developer creates a stateless session bean. This session bean needs data from a remote system. Reading this data takes a long time. Assume that the data will NOT change during the life time of the…

The correct answer is E. Read the data in a method which is annotated with @PostConstruct. See the full explanation below for the reasoning.

Question

A developer creates a stateless session bean. This session bean needs data from a remote system. Reading this data takes a long time. Assume that the data will NOT change during the life time of the bean and that the information to connect to the remote system is defined in JNDI. Which statement describes how to manage the data correctly?

Options

  • ARead the data in the bean's constructor.
  • BThe data can only be read in the bean's business methods.
  • CRead the data in a method which is annotated with @PrePassivate.
  • DRead the data in a method which is annotated with @PostActivate.
  • ERead the data in a method which is annotated with @PostConstruct.

How the community answered

(26 responses)
  • A
    4% (1)
  • C
    12% (3)
  • D
    4% (1)
  • E
    81% (21)

Community Discussion

No community discussion yet for this question.

Full 1Z0-895 Practice