When i hit a link a window popup is opened.I am having a session managed bean that loads a java.util.List.It is taking few seconds to load that list.
when i click the link twice i am getting concurrent modification exception. because the page is in session mode and first request is still loading the List, before it ends the second request tries to update the list.
I have two possible solution in hand
1) introducing synchronized block
Question : Introducing synchronized block leads to performance issue in multithread environment?
2) javascript to disable the link once it clicked.
problem : Not a good option because we need to restore the state of javascript once the popup is loaded. There is a possibility that the link is disabled forever if the popup window terminated abnormally.
Is there any other solution for this issue?