On Fri, 23 Feb 2001, Thibault Cuvillier wrote:

> Samuel,
>
> Most of the middleware optimize the calls between remote objects:
>         - located in the same process, or JVM, using a direct call
>         - in 2 process on the same machine (using IPC)
>         - in 2 processes on 2 machines (using IP)
>
> You must check with the middleware used on your application server.
> To check, send an exception and look compare the stack trace for a remote
> and remote-local call.
>
> Else, The problem is that remote-local calls may have a different behavior
> than remote calls for the parameters/returned values.
>
> With remote calls you receive a copy of the serialized objects sent by the
> client through the network marchalling.
>
> With local-remote call, you may receive a direct reference (middleware
> dependent).
>
> So the following method will not have the same result if the call is remote
> or local:
>         public void addHello(List list) { /// EJB remote method
>                 list.add("Hello");
>         }
>
>         If the call is remote, the client argument will not change because
> of the marshalling.
>         If the call is local, the client argument will be change (direct
> reference).
>         ** This behavior is dependent of the middleware **
>
> I did not saw in the EJB spec any information about this potential
> portability issue.
> Any idea?
EJB 1.1 spec, section 18.2.3:
The enterprise beans home and remote interfaces are remote interfaces for
Java RMI. The Container must ensure the semantics for passing arguments
conform to Java RMI. Non-remote objects must be passed by value.

Specifically, the EJB Container is not allowed to pass non-remote objects
by reference on inter-EJB invocations when the calling and called
enterprise beans are collocated in the same JVM. Doing so could result in
the multiple beans sharing the state of a Java object, which would break
the enterprise beans semantics.

>
>
> Tibo.
> Valtech
>
> >-----Original Message-----
> >From: Samuel Abraham [mailto:[EMAIL PROTECTED]]
> >Sent: Friday, February 23, 2001 5:49 AM
> >To: [EMAIL PROTECTED]
> >Subject: If the EJBs are on the local machine will it avoid making
> >remote calls?
> >
> >
> >hi,
> >If the EJBs are on the same machine rather in the same JVM, is
> >there any way
> >by which the container will understand this and make a local
> >call to the
> >beans rather than a remote call?
> >If that is the case the communication via stub/skeleton,marshalling
> >/unmarshalling can be avoided.
> >TIA
> >sam
> >_______________________________________________________________
> >__________
> >Get Your Private, Free E-mail from MSN Hotmail at
> >http://www.hotmail.com.
> >
> >===============================================================
> >============
> >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".
> >
>
> ===========================================================================
> 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".
>

--
Dan Christopherson (danch)
nVisia Technical Architect (www.nvisia.com)

Opinions expressed are mine and do not neccessarily reflect any
position or opinion of nVISIA.

---------------------------------------------------------------------------
If you're a capitalist and you have the best goods and they're
free, you don't have to proselytize, you just have to wait.
-Eben Moglen

===========================================================================
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