Hi,
I have noticed that some EJB containers (at least JBoss and JOnAS) optimize local RMI calls by passing objects by reference instead of the default pass-by-value behavior. My question is, is this because prior versions to EJB 2 specification did not address the in-memory invokation issue. Is this the solution to taken by these vendors. The people behind the specification however came up with another solution, to use local objects.
Regards
-
Local objects and RMI pass-by-reference (3 messages)
- Posted by: Mads Pultz
- Posted on: October 07 2002 06:09 EDT
Threaded Messages (3)
- Local objects and RMI pass-by-reference by Tomas Inger on October 07 2002 11:31 EDT
- Local objects and RMI pass-by-reference by Gal Binyamini on October 07 2002 15:05 EDT
- Local objects and RMI pass-by-reference by Jyot Singh on October 16 2002 02:52 EDT
- Local objects and RMI pass-by-reference by Gal Binyamini on October 07 2002 15:05 EDT
-
Local objects and RMI pass-by-reference[ Go to top ]
- Posted by: Tomas Inger
- Posted on: October 07 2002 11:31 EDT
- in response to Mads Pultz
Hi!
First of all, the EJB container is not allowed to pass a reference when calling a (non-local) EJB from another EJB in the same container. However, the container is allowed to use a faster protocol than RMI to do the call. But such a protocol must have the same effect as the standard Java RMI. As an example, I have heard that OC4J has an internal protocol 50 to 100 times faster than Java RMI.
See sections 5.2 and D.6 (appendix) of the EJB 2.0 spec. for details.
/Tomas -
Local objects and RMI pass-by-reference[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: October 07 2002 15:05 EDT
- in response to Tomas Inger
Tomas is right as far as the spec goes, but in practice some application servers did optimize EJB calls using pass-by-reference, as a configurable optimization. The reason is exactly what you suggested: prior to EJB 2.0, all calls were remote, and this caused a substantial overhead. This is probably the biggest reason for the addition of local interfaces to the spec: when a non-standard feature that breaks the spec becomes a "pseudo-standard", something in the spec has to be fixed.
Gal -
Local objects and RMI pass-by-reference[ Go to top ]
- Posted by: Jyot Singh
- Posted on: October 16 2002 14:52 EDT
- in response to Gal Binyamini
I agree with Gal, All Weblogic versions even prior to release of EJB2.0 use to have pass-by-value enables.Thus,optimising the calls within the local JVM.
Also,you can configure your App Servers to use pass by value or pass by reference.
-Jyot
Data Concepts,LLC