-
1. Re: EJB3 CallByValue=false, but acts like its true
jaikiran Jun 11, 2008 2:39 AM (in response to fisherv)Are you calling the EJBs using the "remote interface" of the EJBs? As per the EJB3 Core specification 3.2.1, the parameters and return types are passed by value (which means that any changes to the parameters inside the bean will not be visible to the caller):
3.2.1 Remote Clients
The arguments and results of the methods of the remote business interface are passed by value.
Use the "local interface" to invoke the bean methods to pass the objects by reference. -
2. Re: EJB3 CallByValue=false, but acts like its true
fisherv Jun 11, 2008 8:46 AM (in response to fisherv)Thanks Kairan.
You're right - I have been using remote. I thought that this JBoss EAR deployer CallByValue option was a feature implemented above and beyond the specification - it is, isn't it?
I considered switching to local, but that just leaves the potential problem for someone else to solve down the line if remote calls are ever needed later. I'm changing the code to work as call by ref - though this may involve changes in a number of places.
I'm generally against using local for just this reason - your code may stop working if you ever change up your EJB allocation among JVMs/hosts! -
3. Re: EJB3 CallByValue=false, but acts like its true
jaikiran Jun 11, 2008 10:53 AM (in response to fisherv)"fisherv@teoco.com" wrote:
I thought that this JBoss EAR deployer CallByValue option was a feature implemented above and beyond the specification - it is, isn't it?
Not sure."fisherv@teoco.com" wrote:
I considered switching to local, but that just leaves the potential problem for someone else to solve down the line if remote calls are ever needed later. I'm changing the code to work as call by ref - though this may involve changes in a number of places.
I'm generally against using local for just this reason - your code may stop working if you ever change up your EJB allocation among JVMs/hosts!
As you rightly mention, using remote interfaces and then coding to expect that the parameters will be passed by reference was not the correct thing in the first place. I guess you will have to change the implementation to fix this.