Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Local versus remote views

 
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
 
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.
 
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.
 
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic