Tapestry 5
  1. Tapestry 5
  2. TAP5-408

Objects that persist in the session should automatically re-store themselves into the session at the end of the request

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.0, 5.1, 5.0.15, 5.0.16, 5.0.17, 5.0.18
    • Fix Version/s: 5.1.0.0
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      I talked about this on the mailing list. HttpSession objects have a requirement that if you dirty an object assigned to it, you have to call setAttribute again, to tell the app server the object has been modified.

      Most of the code within Form.java does this properly ( whenever the tracker is modified, it calls setTracker, or _tracker = tracker, etc ).

      It missed one spot, and this is a very small patch to fix it.

      1. form-session.diff
        1 kB
        Fernando Padilla

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        This is an expansion of the logic related to Application State Objects in 5.0; generalized to all objects that are stored in the Session.

        There will be a new OptimizedSessionPeristentObject interface, and a @ImmutableSessionPersistedObject annotation.

        Show
        Howard M. Lewis Ship added a comment - This is an expansion of the logic related to Application State Objects in 5.0; generalized to all objects that are stored in the Session. There will be a new OptimizedSessionPeristentObject interface, and a @ImmutableSessionPersistedObject annotation.
        Hide
        Fernando Padilla added a comment -

        well, while we cook up the next version, can we apply this small patch to get it working for our distributed sessions?

        but i would encourage the next version to try to only setAttribute if the object has been modified.. or else there would be performance penalties..

        Show
        Fernando Padilla added a comment - well, while we cook up the next version, can we apply this small patch to get it working for our distributed sessions? but i would encourage the next version to try to only setAttribute if the object has been modified.. or else there would be performance penalties..
        Hide
        Howard M. Lewis Ship added a comment -

        I think a better approach might be to change how Tapestry manages session-persistent values in general; much as ASOs are automatically re-stored into the session, we could have all kinds of session-persistent fields (i.e., @Persist("session")) restored ... with special cases for recognizing immutables and optimized objects (that track when they are dirty).

        Show
        Howard M. Lewis Ship added a comment - I think a better approach might be to change how Tapestry manages session-persistent values in general; much as ASOs are automatically re-stored into the session, we could have all kinds of session-persistent fields (i.e., @Persist("session")) restored ... with special cases for recognizing immutables and optimized objects (that track when they are dirty).
        Hide
        Fernando Padilla added a comment -

        please apply this small patch.

        Show
        Fernando Padilla added a comment - please apply this small patch.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Fernando Padilla
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development