[jboss-user] [EJB 3.0] New message: "Are EJB client proxies thread-safe?"

David Balažic do-not-reply at jboss.com
Mon Mar 15 10:30:04 EDT 2010


User development,

A new message was posted in the thread "Are EJB client proxies thread-safe?":

http://community.jboss.org/message/532016#532016

Author  : David Balažic
Profile : http://community.jboss.org/people/xerces8

Message:
--------------------------------------------------------------
Hi!
 
Is it safe to use the same local proxy by the multiple threads?
 
Example:
Properties properties = new Properties();
properties.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
properties.put("java.naming.provider.url", "localhost");
Context context = new InitialContext(properties);
String lookupName = "project1/SomeBean/remote";
SomeRemoteInterface proxy1 = (SomeRemoteInterface) context.lookup(lookupName);
 

 
Can all thread of a client application use that proxy object to perform method calls?
Is it (thread-)safe?
Or should each thread make an own lookup to get an separate proxy object?
 
The server we use is JBoss 4.2.3 and the client will also run on JBoss 4.2.3.
The client is partly a web application (JSP pages).
 
I googled, but I could not find a definite answer. (half of them misunderstand and talk about the server)
 
Regards,
David

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/532016#532016




More information about the jboss-user mailing list