[
https://issues.apache.org/jira/browse/WICKET-6465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16162651#comment-16162651
]
ASF GitHub Bot commented on WICKET-6465:
----------------------------------------
Github user bitstorm commented on the issue:
https://github.com/apache/wicket/pull/233
I agree about the use of a normal boolean, but I'm not sure I've understood
your idea about ThreadLocal. What I would like to do is to prevent race
conditions inside storeTouchedPages. I would do it using synchronized on entry
object:
```
protected void storeTouchedPages(final List<IManageablePage> touchedPages)
{
if (!touchedPages.isEmpty())
{
SessionEntry entry = getSessionEntry(true);
synchronized (entry)
{
entry.setSessionCache(touchedPages);
for (IManageablePage page : touchedPages)
{
// WICKET-5103 use the same sessionId as used
in SessionEntry#getPage()
pageStore.storePage(entry.sessionId, page);
}
entry.updating.set(true);
setSessionAttribute(getAttributeName(), entry);
}
}
}
```
In this way two possible concurrent requests for the same session would
execute storeTouchedPages one at a time.
> PageStore not cleared at session end
> ------------------------------------
>
> Key: WICKET-6465
> URL: https://issues.apache.org/jira/browse/WICKET-6465
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 7.8.0
> Environment: Tomcat
> Reporter: Franta Mejta
> Assignee: Emond Papegaaij
> Priority: Critical
> Attachments: WICKET-6465.patch
>
>
> WICKET-6387 causes the page store not to be cleared at logout on Tomcat. The
> problem is that tomcat does not call {{valueUnbound}} or {{valueBound}} when
> an attribute is set to the current value (new == old).
> https://github.com/apache/tomcat/blob/e28b35c9e40aeb4b7ac52a98f07ad965630e2766/java/org/apache/catalina/session/StandardSession.java#L1424
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)