We have all our business logic written as Stateful EJB component. This doesn't allow concurrent access. So If I have concurrent AJAX call through UI then it throws the Runtime Exception. This exception causes EJB to be removed which leaves the stale reference in session.
We want to queue (synchronized) the request if it is for the same session to avoid the issue. So my question is What is the best way to synchronize the request of same session? Should I just make HttpDispatcher.dispatchRequest() method synchronized?
Thanks.