Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling a stateless EJB 3 annotated Remote in a local context

I would like to know if the EJB 3 specification or the Weblogic vendor specificities give information about the performance/overhead cost of calling with a lookup a stateless EJB which is in a local context (in the same server and the same ear that the class invoking the EJB) but which is annotated Remote in its declaration. I did many searches on the web on the subject and I didn't find a complete response.

Is it the invocation processing is the same that if the EJB was declared local ? So, not expensive. Or, is the invocation processing is which of EJB remote invocation ? So, more expensive.

If you have references about this question, it would be great.

like image 602
davidxxx Avatar asked Mar 02 '26 20:03

davidxxx


1 Answers

Enabling local optimisations is a Weblogic-specific setting. See:

  • https://docs.oracle.com/cd/E13222_01/wls/docs103/ejb/DDreference-ejb-jar.html#wp1113807

When enable-call-by-reference is True, EJB methods called from within the same EAR file or standalone JAR file will pass arguments by reference. This improves the performance of method invocation since parameters are not copied.

Enabling call by reference is not strictly EJB Spec-compliant, since you can no longer guarantee that the parameters of a remote interface are actually clones of the original arguments, but may actually be the original objects, so be careful to make defensive copies if necessary.

like image 185
Trent Bartlem Avatar answered Mar 04 '26 08:03

Trent Bartlem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!