You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Tzvetanov Grigorov (Jira)" <ji...@apache.org> on 2020/03/26 07:18:00 UTC

[jira] [Resolved] (WICKET-6751) Support creating custom page access synchronization strategies

     [ https://issues.apache.org/jira/browse/WICKET-6751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Tzvetanov Grigorov resolved WICKET-6751.
-----------------------------------------------
    Fix Version/s: 9.0.0-M5
         Assignee: Martin Tzvetanov Grigorov
       Resolution: Fixed

Merged the PR!

Thank you, [~thomas.heigl]!

> Support creating custom page access synchronization strategies
> --------------------------------------------------------------
>
>                 Key: WICKET-6751
>                 URL: https://issues.apache.org/jira/browse/WICKET-6751
>             Project: Wicket
>          Issue Type: Task
>          Components: wicket-core
>    Affects Versions: 8.7.0, 9.0.0-M4
>            Reporter: Thomas Heigl
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>             Fix For: 9.0.0-M5
>
>
> While moving from a single server setup to a distributed environment with session management provided by Spring Session, I discovered that the current implementation of {{PageAccessSynchronizer}} does not work in that scenario:
> It assumes that all requests of a session work on an identical session object, where it keeps all current locks. This isn't the case for Spring managed sessions.
> See my original post to the users mailing list:
> [http://mail-archives.apache.org/mod_mbox/wicket-users/202002.mbox/%3cCANtfzo5+YTBFzyP-U_dVjSrRu8xgv1qj4ozAWxDAbwVnF5=M9Q@mail.gmail.com%3e]
> Implementing a custom access synchronizer that stores locks in a static variable or in the application solves these issues. But providing a custom implementation is very cumbersome at the moment. Users have to override all concrete methods in the base class and completely duplicate the {{PageLock}} class because {{waitForRelease}} and {{markReleased}} have package visibility.
>   
>  I suggest to make these two methods in {{PageLock}} public so the class can be reused and extract all the locking logic into an {{ILockManager}} with 3 methods: {{lockPage}}, {{unlockPage}}, and {{unlockAllPages}}. The default lock manager could hold the session-scoped locks collection and custom implementations could provide their own locking mechanism.
>   
>  These changes should be quite straight forward. I can provide a PR if necessary.
>   
>  Since the changes required are not entirely backwards compatible, I guess that the PR target would be Wicket 9.
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)