Passing data to EJB by refrence

Discussions

EJB design: Passing data to EJB by refrence

  1. Passing data to EJB by refrence (5 messages)

    Hi,

    Is it possible to pass data to the EJB by refrence? Can I pass a object to the enterprise bean's method, modify the object, and will it be reflected in the calling method?

    Regards,
    Amar

    Threaded Messages (5)

  2. Passing data to EJB by refrence[ Go to top ]

    This is interesting. App server communicates with client basically using the RMI protocol.

    In RMI, if I pass an object like MyString for instance to the app server by reference(the object first has to implement java.rmi.Remote), if the server calls a method in MyString, eg length(), the length computation actually executes on the client-side.

    I wonder anybody has tried this in the context of an app server.

    Benedict Chng
  3. Passing data to EJB by refrence[ Go to top ]

    The EJB spec requires as parameters to be passed by copy and not by reference. The only "Remote" objects in an RMI sense in EJB are Home and Remote interfaces so only these may be passed by reference. All other parameters and return types are passed by copy.

    Dave Wolf
    Internet Applications Division
    Sybase
  4. Passing data to EJB by refrence[ Go to top ]

    WebLogic 5.1 allows you to pass method arguments by reference in the same VM through the enable-call-by-reference element in the weblogic specific deployment descriptor.

    By default this is true and so you must explicitly force the server to pass the arguments by value for each bean that is deployed.

    I don't know of any way of passing by reference across VMs

    Aaron Robinson
    J2EE architect
  5. Passing data to EJB by refrence[ Go to top ]

    Note this is totally non portable.

    Dave Wolf
    Internet Applications Division
    Sybase
  6. Passing data to EJB by refrence[ Go to top ]

    Hi,

    Thanks for the replies. I was trying to pass PrimaryKey Class to a method of a session bean, which i was trying to pass by refrence. But instead of that, now i will write a method of a session bean which will return a PrimaryKey class. So i need not worry about passing by refrence.

    Again thanks for the interest and suggestions,
    Amar