Do app servers optimize bean to bean calls????

Discussions

EJB design: Do app servers optimize bean to bean calls????

  1. Do app servers optimize bean to bean calls???? (8 messages)

    We are considering the session bean as a facade to entity bean pattern. The question is whether or not the popular app servers optimize the communication between beans if beans are instantiated within the same server process.
    Reassurance here it would be helpful. Otherwise, we will go with custom written data access objects rather than pay the huge RMI performance penalty when using Entity beans. My guess is that some app servers do a better job than others.

  2. weblogic does
  3. Both WebSphere and WebLogic does this, but I can only tell you the details regarding how WebSphere it. When you install WebSphere, the "no local copy" feature in the administration tool will be set to "off", meaning that the parameters sent between two beans in the same JVM will be sent by value. If you turn "ON" this feature, then the parameters will not be sent by value, but rather referenced by the other bean. Two caveats:
    1. Obviously, this is a proprietary feature.
    2. As with all references, there is a possibility that the value of your parameter may be modified from with the second bean's method, if you are very careful.
    -Srini...
  4. Weblogic has similar feature by using weblogic speccfic deployment descriptor.
    check this on-line doc out
    http://e-docs.bea.com/wls/docs60//////ejb/reference.html

    Here is the abstract:

    By default, EJB methods called from within the same server pass arguments by reference. This increases the performance of method invocation because parameters are not copied.

    If you set enable-call-by-reference to False" parameters to EJB methods are copied (pass-by-value) in accordance with the EJB 1.1 specification. Pass by value is always necessary when the EJB is called remotely (not from within the server).

    Example

    The following example enables pass-by-value for EJB methods:
    <weblogic-enterprise-bean>
      <ejb-name>AccountBean</ejb-name>
    ...
      <enable-call-by-reference>false</enable-call-by-reference>
    </weblogic-enterprise-bean>
  5. Thanks. This makes me feel better. Now my only concern is that some servers may not optimize. We have a requirement here that our app must be easily portable to any J2EE certified app server (iPlanet will be a given). Given this, we may run into a huge performance penalty if we have to deploy to a server without optimized calls.

    I guess we'll have to make the decision based on the perf penalty we are willing to put up with. I hesistate though to base a design on a "performance enhancement" assumption that is not part of the spec.

    agree?
  6. With EJB 2.0, there is some possibility (I read that in this site) that this may become a standard. I am sure that this will become a standard. You shouldn't be using dependent objects and BMP because of this performance issue. Isind't the whole purpose of EJBs to give you Persistence, Transaction, Security and Sacalability, thus letting you concentrate on writing your business logic?

    Keep your fingers crossed and proceed with this "for now" proprietary feature...

    -Srini...
  7. One thing to bear in mind.....

    When developing and testing, do make sure you at least try it across servers.

    I have seen too many people get it all developed and tested on one server. Then they try to make the supposedly "easy" step to split it across servers.

    Oooops, lots of things aren't Serializable and it all goes pear shaped. Won't happen if it's passing references around or passing copies. WebLogic won't check this internally. It'll only blow up when the transport classes try to serialize it over the wire.

    Other than that, everything else said here about pass by ref versus pass by value is pretty important too.

    Chz

    Tony
  8. I know weblogic does, and I think iPlanet handles this as well, but it is outside of the EJB 1.1 spec and therefore proprietary. Another concern I have of this feature is that it may not have any affect when dealing with clustered servers - where communicating beans are instantiated on independent vms... in fact I can't see how it would have an effect - communication probably reverts to RMI.
  9. Markus Blumrich 2001-04-10 12:24:02.0. said:
    I know weblogic does, and I think iPlanet handles this as well, but it is outside of the EJB 1.1 spec and therefore proprietary. Another concern I have of this feature is that it may not have any affect when dealing with clustered servers - where communicating beans are instantiated on independent vms... in fact I can't see how it would have an effect - communication probably reverts to RMI.



    Clustered EJb servers direct requests from one EJB to another to an implementation within the same JVM whenever possible. WebLogic does this and I would expect any clustered server to do the same - otherwise it wouldn't be very competitive.

    Of course, if the EJB isn't deployed locally, your gonna get the remote call.

    Chuck