This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Pass by reference not working between remote EJB calls  RSS feed

 
Amol Gaikwad
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2902
196
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!