Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Effect of enable-call-by-reference

I get the messages

<Warning> <EJB> <BEA-010202> <Call-by-reference is not enabled for the EJB 'myEjb'.
The server will have better performance if it is enabled. To enable call-by-reference, set the enable-call-by-reference element to True in the weblogic-ejb-jar.xml deployment descriptor or corresponding annotation for this EJB.>

and

<Warning> <EJB> <BEA-012035> <The Remote interface method: 'public abstract java.util.Collection my.sessionfassade.ejb.myFassade.myMethod(java.lang.String,java.lang.String,java.util.Collection) throws my.Exception' in EJB 'myEjb' contains a parameter of type: 'java.util.Collection' which is not Serializable. Though the EJB 'myEjb' has call-by-reference set to false, this parameter is not Serializable and hence will be passed by reference. A parameter can be passed using call-by-value only if the parameter type is Serializable.>

Why would this not be enabled by default, as remote calls are still possible and done by value if the flag is set to True? Is there any negative effect when setting it to True?

like image 268
stracktracer Avatar asked Jun 06 '11 12:06

stracktracer


1 Answers

call-by-reference = true is not compliant with the EJB specification.

The goal of remote EJBs was to provide a location transparency. In other words, if the target EJB is in another JVM, then clearly the data must somehow be copied to that JVM, so for consistency, calls to an EJB in the same JVM are also copied. If calls to an EJB in the same JVM weren't copied, then the caller/callee wouldn't know whether they need to defensively copy an ArrayList, for example. By always copying, this ambiguity is removed but at the cost of performance.

If you can fully trust all clients and EJBs in the same JVM and you establish a convention for copying data when necessary, then you can enable call-by-reference = true.

like image 58
Brett Kail Avatar answered Sep 18 '22 22:09

Brett Kail