1 Reply Latest reply on Mar 10, 2004 3:49 AM by amayingenta

    Reference Argument

    pedrocordeiro

      I am passing an argument to a Session Bean's method and its contentes are being altered within it. I thought it was passed by value, according to the J2EE specification. What is hapenning?

        • 1. Re: Reference Argument
          amayingenta

          Because the RMI call is within the same VM it's being optimized by JBoss. So the arguments aren't serialized and pass-by-value becomes pass-by-reference.

          When we used to use WebLogic it used to do the same thing, so I don't think it's an unusual optimization.

          You can make the RMI calls behave as if everything was remote by changing conf/jndi.properties (adding in a "java.naming.provider.url") - but this will slow things down a lot so I don't recommend it. I'm not sure if there's any other way to force pass-by-value.