Lawrence Marsh wrote: > 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.
Why would you need to synchronize this call at the home interface level? Seems a rather odd requirement to me. Effectively the code is going to allow multiple users to make calls to create things in parallel anyway. Think of a web server farm where you have multiple servlet instances all attempting to create, find and remove bean instances. At the container level, the server has to deal with the multi-threading issues anyway, so you really aren't going benefit by putting it on the home interface. In addition, I have this niggling feeling that methods of an interface cannot be declared synchronized. Don't have the JLS handy to check on this though so feel free to correct me otherwise. -- Justin Couch http://www.vlc.com.au/~justin/ Freelance Java Consultant http://www.yumetech.com/ Author, Java 3D FAQ Maintainer http://www.j3d.org/ ------------------------------------------------------------------- "Humanism is dead. Animals think, feel; so do machines now. Neither man nor woman is the measure of all things. Every organism processes data according to its domain, its environment; you, with all your brains, would be useless in a mouse's universe..." - Greg Bear, Slant ------------------------------------------------------------------- =========================================================================== 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".
