Can concurrency cause StalePageException in wicket

Viewed 19

We are facing StalePageException very frequently. I tried debugging on locally by adding debug point in getStoredPage() method just before this code and then i tried another request for same flow . The render count is not updated but on production i could see this issue. Can any one help what is causing this and how can i reproduce .

if (renderCount != null && pageInstance.getRenderCount() != renderCount)
                {
                    throw new StalePageException(pageInstance);
                }
1 Answers

StalePageException is usually being thrown when the user opens several browser tabs/windows for the same page instance, for example by copy/pasting the current url from the address bar. Then making some more requests in one of the tabs and then trying to use one of the other tabs.

Wicket makes this check so that the user do not use a stale page instance. Imagine a page that shows the details of some entity. If the user deletes this entity in tab1 then (s)he should not be able to edit the same entity in another tab.

Related