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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With