Tapestry 5
  1. Tapestry 5
  2. TAP5-206

Document that you should not instantiate an @Persist field in its declaration

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.15
    • Fix Version/s: 5.0.16
    • Component/s: None
    • Labels:
      None
    • Environment:
      N/A

      Description

      Because of Tapestry's page pooling, persistent objects can behave in strange ways if not handled properly. Issues can arise when setting a value on a persistent property at the same time as declaring it.

      I ran into this issue while doing something similar to this: http://www.nabble.com/Strange-behavior-when-instantiating-properties-directly-in-the-page-p17876779.html

      I propose that a note is added to the User's Guide -> Persistent Data page to warn users of this potential issue.

        Issue Links

          Activity

          Hide
          Geoff Callender added a comment -

          Is there a situation in which it makes sense to initialise a field AND annotate it with @Persist?

          If not, then it would be great if Tapestry detected it and threw an exception. I've been caught out by this too and it's a huge time-waster.

          Show
          Geoff Callender added a comment - Is there a situation in which it makes sense to initialise a field AND annotate it with @Persist? If not, then it would be great if Tapestry detected it and threw an exception. I've been caught out by this too and it's a huge time-waster.

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Dave Dombrosky
            • Votes:
              2 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development