• Post Reply Bookmark Topic Watch Topic
  • New Topic

network cost local ejb vs remote ejb  RSS feed

 
Nadine McKenzie
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do local ejb's incur a network cost? If yes, how does it compare to the cost of a remote call?
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No network call is involved in executing a local ejb. Additionally, parameters are pass-by-reference for local ejb calls so you won't incur the cost of serialization either. BTW, most J2EE Application Servers these days will optimize out the cost of remote calls made within the same jvm or at least provide an option to optimize.
 
Andreas Schaefer
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A word of caution with respect to local interfaces. Because of class loading issues you can only use a local interface safely within the same application (JAR or EAR file) and within the entire application server.

-Andy
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a server such as WebLogic Server, you can can configure it to enable pass by reference for remote calls to EJBs within the same application. However, this server will always use pass by value if calls are made between applications - even if they are in the same JVM.
 
Nadine McKenzie
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I thought. Pass by reference and the fact that the object is not being serialized (marshalled and unmarshalled). I needed to know anyways in case there was something I was missing. ThanKs folks!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!