• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Question on page 71/76 in HeadFirst EJB

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic