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

Local versus remote views

 
Jakub Korab
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
There's something I'm have trouble with. I was going through an sample question in HFEJB to do with what could access what and it messed me up. To paraphrase:
You have a remote client 'R', that has valid references to session beans 'A' and 'B'. A is a local client to B.
Apparently, R can pass its reference for A to B. The handle(?) for A gets serialized and passed to B. I can live with that.
I'm assuming that R is in a different VM to A and B (remote), and that A and B share a VM (local). A has a local view of B.
Now what's just happened is that R has passed its remote view of A to B, presumably so that B can do something with A. Given that you can't mix remote and local syntax, B therefore has to reference A as a remote object, going through stub, EJBObject and then to the bean itself in order to call a method.
Firstly - is this actually legal? My impression was that you had to use a local view within the same VM. And if it is, why not just handle every bean via the remote syntax? Narrowing and checking for a RemoteExceptions doesn't seem like that big a price to pay for a standard way of handling all EJBs.
I'm definitely missing something here...
Jake <- I couldn't wait to use one of these things
 
Janne Karhu
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right about one thing - narrowing itself is probably not very ineffective. But using remote interfaces usually is; the container must serialize all the input parameters and return values (according to standard). When there is a lot of traffic in the ejb server, the use of local interfaces is a lot more scalable solution.
 
Jakub Korab
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Janne, that clears it up.
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, don't forget that for cmr, you must use local interfaces.
 
Jakub Korab
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got a very quick education in the subtleties of CLASSPATHs when I suddenly didn't have an Ant script.
Jake
 
Jakub Korab
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops replied to the wrong message.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic