Dear Friends,
I am calling a method of session bean in ejb client. I am passing a vector to this method. I want the vector to be passed by reference so that whatever changes I make in it in session bean method, these are reflected beack in client without returning the vector.
In general, how to pass the objects by reference over the network?
Varun
-
How to pass Object by Reference over the network in ejb? (9 messages)
- Posted by: Web Master
- Posted on: September 06 2000 09:11 EDT
Threaded Messages (9)
- How to pass Object by Reference over the network in ejb? by Floyd Marinescu on September 06 2000 12:43 EDT
- How to pass Object by Reference over the network in ejb? by fengliang wu on September 08 2000 22:16 EDT
- How to pass Object by Reference over the network in ejb? by Anand Balasubramanian on September 06 2000 13:44 EDT
- How to pass Object by Reference over the network in ejb? by Dimitri Rakitine on September 06 2000 15:26 EDT
- How to pass Object by Reference over the network in ejb? by Ajay Amrite on September 07 2000 01:10 EDT
- How to pass Object by Reference over the network in ejb? by Dimitri Rakitine on September 07 2000 02:38 EDT
- How to pass Object by Reference over the network in ejb? by Ajay Amrite on September 07 2000 01:10 EDT
- How to pass Object by Reference over the network in ejb? by Edmund Fliski on September 08 2000 15:37 EDT
- How to pass Object by Reference over the network in ejb? by David Lu on September 14 2000 10:59 EDT
- Re: How to pass Object by Reference over the network in ejb? by w zh on July 12 2007 02:27 EDT
-
How to pass Object by Reference over the network in ejb?[ Go to top ]
- Posted by: Floyd Marinescu
- Posted on: September 06 2000 12:43 EDT
- in response to Web Master
Varun,
In RMI (the communications protocol used by EJB), the vector you pass over gets serialized. That is, a complete copy of its current state gets passed over the wire to the EJB, which "deserializes" it into a copy of the original vector. I don't know of any way to pass by reference. You will just have to return a vector.
Floyd -
How to pass Object by Reference over the network in ejb?[ Go to top ]
- Posted by: fengliang wu
- Posted on: September 08 2000 22:16 EDT
- in response to Floyd Marinescu
Support! -
How to pass Object by Reference over the network in ejb?[ Go to top ]
- Posted by: Anand Balasubramanian
- Posted on: September 06 2000 13:44 EDT
- in response to Web Master
Hi,
One Basic concept in RMI is nothing like pass by referance.All the parameters paased to the method are pass by value only. -
How to pass Object by Reference over the network in ejb?[ Go to top ]
- Posted by: Dimitri Rakitine
- Posted on: September 06 2000 15:26 EDT
- in response to Web Master
You can instantiate RMI object which wraps your Vector and use it. This will achieve 'pass by reference' functionality. -
How to pass Object by Reference over the network in ejb?[ Go to top ]
- Posted by: Ajay Amrite
- Posted on: September 07 2000 01:10 EDT
- in response to Dimitri Rakitine
Hi Dimitri Rakitine,
Can you please elaborate on this point. -
How to pass Object by Reference over the network in ejb?[ Go to top ]
- Posted by: Dimitri Rakitine
- Posted on: September 07 2000 02:38 EDT
- in response to Ajay Amrite
You can create RMI remote object in your client and use it as a parameter when calling your server - that will achieve 'pass by reference' behaviour. -
How to pass Object by Reference over the network in ejb?[ Go to top ]
- Posted by: Edmund Fliski
- Posted on: September 08 2000 15:37 EDT
- in response to Web Master
For a heavyweight component making it an EJB could be a good solution, too. Maybe your vector is semantically just a property of a broader business logic object... -
How to pass Object by Reference over the network in ejb?[ Go to top ]
- Posted by: David Lu
- Posted on: September 14 2000 10:59 EDT
- in response to Web Master
I believe that RMI simulates pass by reference by passing a stub of the remote object by value. That is, it serializes the stub and passes the stub to the other side.
See page 521 of Mastering EJB which is downloadable from this site.
-David -
Re: How to pass Object by Reference over the network in ejb?[ Go to top ]
- Posted by: w zh
- Posted on: July 12 2007 02:27 EDT
- in response to David Lu
You should see page 572 of the new version of the book:Mastering Enterprise JavaBeans 3.0