• 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 not working between remote EJB calls

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, i'm having issues with pass by reference between remote EJB method calls. Below is what i'm trying to do. The EJB method calls are made using remote (EJBObject) interface.

insertEmployeeRecord(Employee employee)
{
employeeEJB.insertEmployee(employee);
empDetailsEJB.insertEmpDetails(employee);
}

insertEmployee(Employee employee)
{
employee.setEmpId(<Oracel sequence number>);
<<<insert employee record into database>>>
}


insertEmpDetails(Employee employee)
{
long empid = employee.getEmpId(); //PROBLEM IS HERE. Here empid value set in insertEmployee method is not received. Instead get returns default value 0.

<<<insert employee details into database>>>
}

All the EJBs have below configuration in the weblogic-ejb-jar.xml file.
<enable-call-by-reference>true</enable-call-by-reference>

I'm using Weblogic server 10.3.0.4 and JDK160_21.

Can someone please let me know if anything is missing here or if any change is needed to get this working?

Thanks in advance.
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amol,

Call by reference is only supported by Local EJBs.

From the oracle docs

Note: Method parameters are always passed by value when an EJB is called remotely.


Regards,
Frits
 
Amol Gaikwad
Greenhorn
Posts: 6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Fret,

This code (using pass by reference) used to work with Weblogic 9.2 but started giving issues when i upgraded to Weblogic 10.3

For Weblogic 10.3 it worked when i bundled all the JAR files into a single EAR file and deployed it as one single deployment unit. It looks like with WLS 10.3, the "enable-call-by-reference" setting in Weblogic deployment descriptor is not considered if the EJBs belong to different deployment units (separate JARs).

Thanks for looking into this.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic