pass by ref or value


EJB programming & troubleshooting: pass by ref or value

  1. pass by ref or value (3 messages)

    I have 2 Ejbs: EjbA and EjbB
    in EjbA call EjbB's method:
    m1(Map m)

    EjbA lookup EjbB and get remote interface(not local interface).but EjbA and EjbB are on the same server

    in m1(Map m) I modified m by m.put("a",newvalue)

    in EjbA,I can get newvalue by call this method.

    I heard that if call ejb through remote interface,the parameter pass by value,through local interface, parameter pass by refrence(faster).
    but why looks like in my case, it pass parameter by refrence even through remote interface?

    Threaded Messages (3)

  2. Optimisation[ Go to top ]

    Some containers will automatically treat all EJBs in the same VM as local EJBs, thereby passing parameters by reference.
  3. Optimisation[ Go to top ]

    Thank cleared the you know if websphere or weblogic have such features?
  4. Optimisation[ Go to top ]

    It actually depends on the following
    1. Bundling of the classes (Are the classes bundled in the same EAR file??)
    2.Value of the Pass-By-Value tag for each bean.
    3. JVM.