• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reference of remote (RMI)

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In a rmi program...the client is passing an object as a parameter in a remote method invocation...and in the server...

a copy of the object is created if am not wrong..


Is it true that any change i do of the object at my client side would cause the change of the same object at the server side or vice -versa...
server object changes and the same is reflected in the client ..object..

Thanks in advance,
Regards
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Absolutely not.

As you said, a copy of the object is made on the server side. Changes on the server do not reflect on the client and vice versa.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends... are you passing a Seriailizable object as a parameter, or a Remote object as a parameter.

If you pass a Serializable - the server gets a copy - changes do not update.

If you pass a Remote - the server gets a stub - changes do update.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nathan,

I didnt get this...

It depends... are you passing a Seriailizable object as a parameter, or a Remote object as a parameter.


Can you be more clear about this...

Thank you...

Regards
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the introduction to section 2.6, 2.6.1, and 2.6.2 in the RMI specification.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!