ConcurrentAccessException - Indicates that the client has attempted an invocation on a stateful session bean or singleton bean while another invocation is in progress and such concurrent access is not allowed.
However, on p.23 of the notes,
A singleton session bean instance is shared between clients and support concurrent access.
Due to the fact that a singleton session bean support concurrent access, why the single bean will throw ConcurrentAccessException?
Singleton session bean indeed supports concurrent access, and various aspects of its concurrency can be tweaked using following annotations:
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.