An EJB may be called through its local interface from:
1) the same ejb module 2) other ejb modules in the same EAR 3) a web module in the same EAR 4) other ejb modules in a different EAR 5) a web module in a different EAR
Hi, The question seems to be slightly confusing to me. As per my understanding any component can make local call to an ejb as long as it is in the same jvm. Here question does not specifies whether the different ears are on the same server (same jvm) or on different server.
Do we really get these kind of questions in exams?
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
I also agree with Prakash... local or remote depends on whether or not EARs are deployed in same JVM or different JVM.
However, the given answer can be true only if each EAR gets a different instance of JVM... I don't know whether this happens... I'm just guessing...
SCJP 1.4 : 91%
SCWCD 1.4 : 95%
SCBCD 1.3 : 95%
SCJP 6 Upgrade : 95%
Next SCBCD 1.5
Man is not finished when he is defeated. He is finished when he quits.
Originally posted by AmitKumar Jain: I also agree with Prakash... local or remote depends on whether or not EARs are deployed in same JVM or different JVM.
However, the given answer can be true only if each EAR gets a different instance of JVM... I don't know whether this happens... I'm just guessing...
sorry I am not getting your answer Remote certainly means different JVM.. What could be the most probable answer then ?
1) the same ejb module 2) other ejb modules in the same EAR 3) a web module in the same EAR 4) other ejb modules in a different EAR 5) a web module in a different EAR
In case of remote 1,2,3,4,5 is true
Remote or local depends on how the interface both Home and Component Interface is defined In case of Remote the Container generates the code for RMI-IIOP related code while implementing the Home and Component Interface (EJBHome and EJBObject extends Remote)
So whether it runs on the same JVM or not it doesnt matter if the interface is declared remote within the same EAR it will follow the same principle as if calling some remote interface.
Some container however optimizes the call when they finds out the call is actually a local call "One Client calling a EJB within the same EAR"
SCJP 5<br />Brainbench Certified in C++<br />PMP<br />Dallas,TX