Title: RE: EJBHome and thread safety

Hi Lawrence
 From what you've said, I guess your client code looks like this:

public class EJBClient
        {
        private EJBHome myHome;
        ...
       
        public void setEJBHome()
                {
                //create Initial Context, get a reference to the EJBHome;
                }

        public void createRemote()
                {
                Object obj=myHome.create();     //here
                ..........
                }
        }

From what I can make out, you want to know whether you will need to place the commented statement (//here) in a synchronized block, to ensure multiple threads executing the createRemote() method do not end up messing around with each other.

Now if this is what you asked, then it is absolutely safe because anyways, the Home object is SHARED across multiple clients, isn't it. (you get the same EJBHome thru' JNDI.....)

If you need further clarification, I will be pleased to oblige....

Regards

Sanjeev

-----Original Message-----
From: Lawrence Marsh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 6:22 PM
To: [EMAIL PROTECTED]
Subject: EJBHome and thread safety

Hi

Is the EJBHome object thread safe? I have looked in the spec and
Monson-Haefels "Enterprise Java Beans" and can find nothing about this in
either (though I may have missed something of course) I am caching a
reference to an EJBHome and want to know if I need to add synchronisation
around the create() method so that it works Ok in a mult-threaded
environment. I am doing this in a J2EE Client - not in the comntaier itself.

Cheers

Lawrence


Visit us at http://www.clearstream.com

IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream International does not
accept legal responsibility for the contents of this message.

The information contained in this e-mail is confidential and may be legally privileged. It is
intended solely for the addressee. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are those of the
individual sender, except where the sender specifically states them to be the views of
Clearstream International or of any of its affiliates or subsidiaries.

END OF DISCLAIMER

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

Reply via email to