• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page 168 :)

 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Given a remote client 'R', that has valid references to session beans 'A' and 'B', and given that A is local to B, which statements are true?
Amongst others I chose:
A. R cannot pass his reference for A, to B.
And that was wrong. And I dont know why. R client passes reference of remote A to remote B then the serialized stub is sent. But what the use of the stub A to the bean B which is local to A? And if B expects that A is local to him all those bad things may happen (like treating arguments as real references instead of copies, exceptions etc).
Another day another tough question...
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am so sad nobody looks in my questions
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vladas,
I am so sad nobody looks in my questions.

I understand that sort of frustration !
If nobody answers to you, I guess that nobody who read it felt comfortable with your question. Kathy, Bert or Valentin should be back soon or later ...
BTW, you'd make a good advertiser !
Back to the question :

Given a remote client 'R', that has valid references to session beans 'A' and 'B', and given that A is a local client to B, which statements are true? (Choose all that apply.)
A. R cannot pass his reference for A, to B.
X B. A cannot pass his reference for B, to R.
C. A cannot invoke methods on B.
X D. B cannot invoke methods on R.

Correct answers are B and D.
The book's explanation ("You can't give a remote client a local reference, A sees B through a local reference") explains B (A's reference to B is local and R is a remote client).
C. is easy : A is a local client of B, so it can invoke methods on B.
D. is easy too : B is the remote target in the R/B remote relationship. EJB doesn't support callbacks to the remote client.
I think with you that A is more subtle, because it all turns around the verb used : "pass". R having a remote reference to A, it can pass it to its remote client B. So answer "A" must stay unchecked. But would it make sense ? (I think that's your question). Put in other words, will B be able to do anything useful with a remote reference to A ? Given the question, we don't know. B should be a remote client to A (not stated in the question), having a remote reference to A defined in the DD (<ejb-ref> element), which is neither stated in the question. So yes, R can pass his reference to B. While what B can (or cannot) do with it we simply don't know from the question.
Kathy, if you read this, please comment.
Best,
Phil.
[ December 07, 2003: Message edited by: Philippe Maquet ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic