1. ICEfaces
  2. ICE-8623

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


    • 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:
    • Environment:
      MyFaces, Samples
    • Affects:
      Sample App./Tutorial, Compatibility/Configuration


      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:

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

       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.


        Ken Fyten added a comment -

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

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


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


            • Created: