EJB programming & troubleshooting: pass by ref or value
I have 2 Ejbs: EjbA and EjbB
in EjbA call EjbB's method:
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?
Some containers will automatically treat all EJBs in the same VM as local EJBs, thereby passing parameters by reference.
Thank you.you cleared the fog.do you know if websphere or weblogic have such features?
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.