-
1. Re: Are EJB client proxies thread-safe?
xerces8 Mar 15, 2010 1:28 PM (in response to xerces8)I did a quick test client that looks up one proxy and then calls a method on it from multiple threads.
If the bean is Stateful, I get immediatelly a javax.ejb.ConcurrentAccessException.
If the bean is Stateless, I get no error and it seems to work. Can I assume that it is thread safe?
Are there any docs or specs? The EJB spec is a bit unlear on this issue (for me at least).
-
2. Re: Are EJB client proxies thread-safe?
wolfc Mar 15, 2010 5:44 PM (in response to xerces8)As of JBoss AS 5.0.0, they are:
https://jira.jboss.org/jira/browse/EJBTHREE-666
https://jira.jboss.org/jira/browse/EJBTHREE-697
See 4.3.13 of the EJB 3.0 specification.
-
3. Re: Are EJB client proxies thread-safe?
xerces8 Mar 18, 2010 11:24 AM (in response to wolfc)So in 4.2.3 they are not thread safe?
Should each thread have an own EJB stub?
-
4. Re: Are EJB client proxies thread-safe?
henk53 Apr 18, 2010 7:57 AM (in response to xerces8)Additionally in EJB 3.1 (JBoss AS 6), one can specify what needs to happen if multiple threads access the same client proxy simultaneously.
The default behavior in EJB 3 is to serialize access. In EJB 3.1 this is still the case for session beans other than a Singleton session bean, and obviously for non-asynchronous methods, but as an alternative you can now request that an exception is thrown instead.