I understand the need for doing a narrow on the object that we obtained through the JNDI lookup. My question is would the code below works (assuming the vendor uses IIOP):
I got the above code from the EJB Cookbook. I thought we shouldn't be doing a normal casting at the lookup code. But the next line does the narrowing as mandated by the EJB specifications.
Also, can we do this:
I thought the purpose of narrowing is to ensure that the object we obtained from the lookup is really EJB home that we want. Is it safe enough to do create an EJB & narrow this bean to what we want? Again, this code comes from the EJB Cookbook.