Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on page 71/76 in HeadFirst EJB

 
Shreyas Reddy
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Under the bullet points,
if an object is passed as an argument or retunr value, the object is sent as a serialzed copy, then deserialized on the Remote object's local heap.

Once the remote object works on the locally created object/deserialized object(pages 69-71), what will happen to that object?
I mean if we look at page 71, a Dog object is created on remote heap. remote object's method does whatever is needed to that object. After that does the skeleton serialize the Dog object again and send it to the stub? And then does the client get the newer version of the dog object, if it was modified by the remote object?

I hope my question was clear enough.
thanks in advance...
 
Premkumar Gopal
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
1.Once the remote object works on the locally created object/deserialized object(pages 69-71), what will happen to that object?
Shouldn't this be garbage collected.

2.After that does the skeleton serialize the Dog object again and send it to the stub?
Please refer to the page no.67 (the last para states that "Then it all happens in reverse". So skeleton should package and stub has to unpack the argument(here it is the Dog object).

3.And then does the client get the newer version of the dog object, if it was modified by the remote object?
I believe it should get a newer version of the dog object, even if there is no change to the dog object. Otherwise there will be lot of overheads in checking whether the object is changed or not.
Of course, once we talk in terms of enterprise beans answers to qns (1) and (3) might vary. I have not read the HFE completely(as I started reading it since yesterday), I think people who have mastered EJB will share their opinions.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic