I had a college friend present a situation to me yesterday that seems quite
perplexing!  Consider the following two java classes that run in a single
JVM:

class Huh {

        StringBuffer sb = new StringBuffer("Amit ");

        public Huh() {
                super();
                Huh2 h2 = new Huh2();
                h2.passIt(sb);
                System.out.println(sb);
        }
        public static void main(String[] args) {
                new Huh();
        }
}


class Huh2 {
        public void passIt(StringBuffer sb) {
                sb.append(" Stanlick");
        }
}

Output produced by class Huh is: Amit Stanlick.

This suggests that the invoked method has the ability to modify the object
passed to it as a parameter, which sounds very normal!  The problem is where
class Huh2 becomes a Session Bean.  Class Huh can obtain a remote reference
to Huh2 and fire the passIt(StringBuffer sb) method, however, the
modification to the StringBuffer IS NOT reflected in Huh!  This seems to
defy the Java way!  Can someone please explain?

Thanks,

J. Scott Stanlick
Lead Software Engineer
Enterprise Rent-A-Car

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to