You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by martin-g <gi...@git.apache.org> on 2017/03/20 21:53:14 UTC

[GitHub] wicket pull request #214: experimenting with suspension of requestCycle via ...

Github user martin-g commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/214#discussion_r107025820
  
    --- Diff: wicket-core/src/main/java/org/apache/wicket/page/PageAccessSynchronizer.java ---
    @@ -93,8 +94,8 @@ public Duration getTimeout(int pageId)
     	 */
     	public void lockPage(int pageId) throws CouldNotLockPageException
     	{
    -		final Thread thread = Thread.currentThread();
    -		final PageLock lock = new PageLock(pageId, thread);
    +		final RequestCycle cycle = RequestCycle.get();
    --- End diff --
    
    This is not a good idea.
    Two threads should not work on the same page instance at the same time.
    This will lead to concurrency related issues.
    E.g. two Ajax requests will have their own Request Cycles but might work on the same page instance this way. Without AsyncContext being needed at all.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---