Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6751

Support creating custom page access synchronization strategies

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 8.7.0, 9.0.0-M4
    • 9.0.0-M5
    • wicket-core
    • None

    Description

      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.
       

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              thomas.heigl Thomas Heigl
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: