I have a question on Question #17 in chapter 4 of the Head First EJB book. The match for "local home" is "d- can be used to retrieve the EJBLocalObject." As I understand, the only method in the local home is the remove(Object) method. I think it should be that you can get the EJBLocalHome from the SessionContext object. Is the answer in the book correct? THanks Brian
Howdy, Brian, this is an excellent question to ask, because it's confusing to people both on mock exams and in the real exam, so thanks for giving me a chance to clear that up... (first off, the question and answers are correct, and now I'll explain what we mean). When we say "local home", we mean the client view of the local home, so that includes create() or find() methods that will return the EJBLocalObject (and not the EJBObject). On the exam, if you see "local home" or "home interface", then we mean *anything* that can be available to the client in the home interface (local or Remote -- if it matters whether it is local or Remote, we will say so in the questions). So that includes both the things the Bean Provider writes in their home interface, as well as things from javax.ejb.EJBLocalHome. (same is true with javax.ejb.EJBHome). If we want to ask about the things which are ONLY in the actual javax.ejb.EJBHome interface (or javax.ejb.EJBLocalHome interface), then we'll name the interface explicitly.
Thank you for clearing that up for me, I had to read that a couple of times but then the light went on One more question on question #9 in Chapter 6, "Which methods from the ENtity Context interface can be invoked from within the ejbCreate method?" Option B, the getEJBObject is selected, but I thought that the EJBObject was not available until the postCreate method? Thanks again for the help! Brian