Monday, November 12, 2012

Websphere EJB Optimization: Convert pass by value calls to pass by reference without Local Interface

I've encountered a specific situation in the project where EJB calls should be optimized to reduce response time and memory footprint without modifying code.

Every J2EE programmer know about EJB local interfaces that enables EJB calls like local method calls as long as client and EJB resides in same physical machine. This option reduces overhead of data serialization and transfer between client and EJB layer and also reduces memory foot print since the data should be copied from one layer to another layer.

How do we enable the same feature for any existing project missing Local Interfaces ?

IBM websphere provides the following options to optimize EJB calls without adding local interfaces.

1) Set "Pass by reference" property  in ORB service to true. Navigate to Application servers --> server_name --> Container services --> ORB service. Find the property "pass by reference" and set the value to TRUE.

2)Specify noLocalCopies in servant.jvm.options (-Dcom.ibm.CORBA.iiop.noLocalCopies=1).

Caution: We must ensure that the application is not negatively impacted by using pass-by-reference semantics. For example, if one bean passes another bean an object, expecting that the second bean can modify the object without affecting the first bean's object.

Enter your Comments