ICEfaces
  1. ICEfaces
  2. ICE-8623

Add org.apache.myfaces.SERIALIZE_STATE_IN_SESSION=false parameter to our samples

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.BETA1
    • Fix Version/s: 3.2
    • Component/s: Sample Apps
    • Labels:
      None
    • Environment:
      MyFaces, Samples
    • Affects:
      Sample App./Tutorial, Compatibility/Configuration

      Description

      By default, MyFaces serializes the state of the view into the session on every single request. One of the reasons for this is to support a true history of the views so that the actual state can be restored for that time (think back button support). Normally, when the feature is active, the current state of the View is serialized to a byte array and stored in the session. When it is not active just a reference to the current View root is stored in the session. The potential side-effects of having this active are:

      * It can be a substantial performance hit if the state is large and the updates are frequent.
      * Classes that can't be serialized will cause an exception during the first interaction.
      * Saving and restoring the state between requests may change the behaviour for components that are not designed for it.

      In addition, Mojarra has a similar behaviour and implementation-specific context parameter (com.sun.faces.serializeServerState) but the default is for it to be off. Some more info can be found here:
      http://myfaces.apache.org/core21/myfaces-impl/webconfig.html#org_apache_myfaces_SERIALIZE_STATE_IN_SESSION
      http://wiki.apache.org/myfaces/Performance

      The way to turn off this feature in MyFaces is to use a context parameter:

      {code}<context-param>
              <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
              <param-value>false</param-value>
          </context-param>{code}
               
       The benefits of turning this off this behaviour include:

      * Improved performance as it saves all the serializing and derserializing work that is done for each client on each request. This is very noticeable in something like the Auction apps where the a request is generated every second by the clock tick.

      * It allows non-serializable objects in the View.
      * Mojarra has a similar setting which is off by default so for testing purposes the two environments are more closely aligned.

      Things to consider when this is inactive:

      * Components that expect this behaviour may behave differently.
      * Serialization issues may not be caught until much later (e.g. during clustering testing).

      The current plan is to turn off serialization to the session per every requests for our main sample applications to mainly improve performance and better align with Mojarra's behaviour.

        Activity

        Hide
        Ken Fyten added a comment -

        ICE-8623: Add the MyFaces context paramater for turning off serialization per request in our main samples.

        Show
        Ken Fyten added a comment - ICE-8623 : Add the MyFaces context paramater for turning off serialization per request in our main samples.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: