Rich,

I did not found anywhere in the J2EE/RMI spec that a proxy has to be
multi-thread safe. I speak about the PROXY, not the remote object (which is
multi-thread safe according to the J2EE spec). This point was confirmed by
Chris Raber who is a trustable guy !

So, if you share a proxy between multiple threads in a client, you must
synchronize the proxy by wraping it in a synchronized smart proxy.

The Synchronized smart proxy and the linked proxy can be stored in a cache
to avoid to many JNDI calls.

You can face this situation if a servlet/JSP cache the proxy to the Home
objects, because each user request will start a new thread. Most of the
systems do not synchronize the cached proxies on a Home, and it looks to
work anyway.....

If more than one client get a proxy to the remote object, there is no
problem, because each client will use it's own proxy instance and server
connection.

This is what I understood from this discussion.

Tibo.

> -----Original Message-----
> From: Rich Johns [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 14, 2000 3:17 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Is a Proxy is thread-safe? - Summary
>
>
> Hi Tibo,
>
> What is the conclusion of this question? Is it really true,
> that if you
> cache EJBHome objects, you must synchronize them? I thought
> the ejb container handled that?
>
> If multiple clients grab the same EJBHome object from JNDI and
> all use it simulataneously, the container must be at work managing
> thread saftey. Or, is it the case that each client gets its own stub,
> which is what allows the thread saftey.
>
> If you have an understanding of this, could you please explain this.
> I've just completed a design where I was planning to cache EJBHomes
> and now I'm not sure.
>
> thanks very much.
>

[cut to save bandwidth !]

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