• 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

Pass-by Reference or Pass-by-Value

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is right out of IBM's Pre-Assessm tool and I am almost clueless as for the answers. Can someone shed a light on this? Thanks in advance.
(Select 2) The EJB 1.1 specifications states that method parameters should be "Pass-by-Value". Under what conditions should the EJB optimization "Pass-by-Reference" be set in WebSphere Application Server Advanced Edition Version 4.0?

a) The EJB client and EJB Server are running in the same JVM (i.e. the same Application Server)
b) The EJB methods' parameters are primitive
object types (int, float, bool, etc)

c) The methods' parameters are not modified by the called method
d) The EJBs employed are using the EJB 1.0 specification level
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Med,
This is a performance tuning question. Pass by reference is better for performance than pass by value.
If you are dealing with primitive, such as int, you always pass by value. However, if you are dealing with object, you may want to pass by reference. I believe WAS allow you to pass by reference.
"The methods' parameters are not modified by the called method" means a object will not be modified. So pass by reference is valid.
"The EJB client and EJB Server are running in the same JVM" means two ref are pointing to the same object at one JVM. It is also fine.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic