Valid 1Z0-899 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-899 Exam! ExamDiscuss.com now offer the newest 1Z0-899 exam dumps, the ExamDiscuss.com 1Z0-899 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-899 dumps with Test Engine here:
A servlet class is injected with a JDBC data source. After injection has occurred, the servlet needs to create a cache out of some of the data in the database, so as to improve responsiveness. Which two methods can host the cache creation code? (Choose two)
Correct Answer: A,D
Explanation/Reference: A: Because the Servlet init() method is invoked when the servlet instance is loaded, it is the perfect location to carry out expensive operations that need only be performed during initialization. By definition, the init() method is thread-safe. The results of operations in the HttpServlet.init() method can be cached safely in servlet instance variables, which become read-only in the servlet service method. D: Example: @PostConstruct private void init() { cached = (Cached) ctx.lookup(EJB_PATH + Cached.class.getSimpleName());