Passing parameters by reference !?


EJB programming & troubleshooting: Passing parameters by reference !?

  1. Passing parameters by reference !? (2 messages)

    Hi there,

    when invoking a EJB method, it seems that all parameters are copied by value (cloned) rather than by reference:

    client : temp.ObjectC@2710
    EJB method : temp.ObjectC@1169

    All the books are saying, that this is NOT the case - Monson-Haefel even has an own chapter about "Passing objects by Value" to an EJB.

    Maybe its just my environment : VAJ 3.02 + WebSphere Testenvironment

    Does anybody have similar experiences with passing parameres by reference to an EJB ???
  2. EJB uses RMI technology.
    according to RMI specification all the parameters are passed by value.
    if u dont want to pass ur parameters by value, there is another solution.

    u make all ur parameters as remote objects.
    (implement remote interface with ur parameter classes)

    then RMI will pass only the stubs of the parameters and not the entire parameter.
  3. Passing parameters by reference !?[ Go to top ]

    All objects except the Home and Remote interfaces MUST be passed by copy in EJB.

    Dave Wolf
    Internet Applications Division