Singleton session bean indeed supports concurrent access, and various aspects of its concurrency can be tweaked using following annotations:
@ConcurrencyManagement
@Lock
@AccessTimeout
So, for instance, if a concurrency management is in its default state (which is @ConcurrencyManagement(CONTAINER)) and the method is of locking type WRITE, client access to all the singleton’s methods is blocked until the current client finishes its method call or an access timeout occurs. When an access timeout occurs, the
EJB container throws a javax.ejb.ConcurrentAccessTimeoutException - which is a child of javax.ejb.ConcurrentAccessException
In other cases, like, if a locking type used is READ, or @ConcurrencyManagement(BEAN) is used, simultaneous access to the bean is permitted, and ConcurrentAccessException will not be thrown upon concurrent calls.
Refer to the
tutorial for further details.