• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB performance due to remote call confusion

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I was trying to improve the performance of an EJB call . I want to understand how many remote call ejb client makes to get the actual object .
If following are a general steps then is it true that client call two time remote call at the time of look up and at the time of create ? Can any body explain this steps

InformerHome home= (InformerHome)ctx.lookup( "ejb/informer" );
Informer informer = home.create();



// get handle into the EJB naming directory
InitialContext ctx = new InitialContext();

// get hold of the object you want by name
InformerHome home= (InformerHome)ctx.lookup( "ejb/informer" );

// get reference to business interface from home interface
Informer informer = home.create();

// use the business interface
informer.getTheTime() ;

 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know in such detailed level what actually happens under the hood when you lookup and get a reference to a remote EJB, but it doesn't sound strange to me that there are actually two distinct calls to remote container.

Anyway if I'm not wrong, you may lookup once EJbs you need and then use their remotely exposed methods; so I don't think you should be worried a lot of how many remote calls in looking up phase are actually made. More likely, you should try to avoid a chatty usage of ejbs (if that's possibile, of course).
 
Monoj Roy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we conclude this way that when we are looking up for the JNDI it calls a remote machine and when we call the home.create of the home object it also gives a remote call ?
 
Claude Moore
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can say only that's likely to happen. To be sure, you can always intercept calls to remote server (using a tpc monitor or tracer listening on your appserver's rmi port) and see what happens at each instruction.
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic