Wicket
  1. Wicket
  2. WICKET-5390

Session management doesn't work with Jetty's JDBCSessionManager

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.11.0
    • Fix Version/s: 6.12.0, 7.0.0-M1
    • Component/s: wicket
    • Labels:
      None

      Description

      I use JDBCSessionIdManager/JDBCSessionManager from Jetty to store my sessions in a DB. Jetty tries to be smart and determines if a session is dirty and only persists it then. The logic is that a call to HttpSession#setAttribute may cause the dirty flag to be set if A) the value is new OR B) the value is changed, i.e. not #equals to the previous value. Wicket stores a PageStoreManager$SessionEntry as an attribute. This class doesn't have a specific equals implementation and so from the Jetty point of view the session never changes. The effect is that after Jetty restores the session from the DB it will be always in the initial state.

      One possible fix is to always return false in SessionEntry#equals. But I'm not sure what Jetty is doing here is correct either.

        Issue Links

          Activity

          Christoph Leiter created issue -
          Hide
          Christoph Leiter added a comment -

          That's the jetty discussion: https://bugs.eclipse.org/bugs/show_bug.cgi?id=408167

          If Wicket always return false in SessionEntry#equals then Jetty will store the page in the DB every time which is also not ideal.

          Show
          Christoph Leiter added a comment - That's the jetty discussion: https://bugs.eclipse.org/bugs/show_bug.cgi?id=408167 If Wicket always return false in SessionEntry#equals then Jetty will store the page in the DB every time which is also not ideal.
          Hide
          Martin Grigorov added a comment -

          I think it is OK to return false in SessionEntry#equals() always.
          The session entry contains a list of all touched stateful pages. Even if the list didn't change in the current request, i.e. it has the same entries, the entries themselves have changed (e.g. a model is updated, or the component tree have changed).

          Show
          Martin Grigorov added a comment - I think it is OK to return false in SessionEntry#equals() always. The session entry contains a list of all touched stateful pages. Even if the list didn't change in the current request, i.e. it has the same entries, the entries themselves have changed (e.g. a model is updated, or the component tree have changed).
          Martin Grigorov made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Martin Grigorov [ mgrigorov ]
          Fix Version/s 7.0.0 [ 12322958 ]
          Fix Version/s 6.12.0 [ 12324889 ]
          Resolution Fixed [ 1 ]
          Christoph Läubrich made changes -
          Link This issue is superceded by WICKET-5473 [ WICKET-5473 ]
          Christoph Läubrich made changes -
          Link This issue is broken by WICKET-5380 [ WICKET-5380 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          10d 23h 32m 1 Martin Grigorov 29/Oct/13 13:16

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Christoph Leiter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development