ICEfaces
  1. ICEfaces
  2. ICE-9348

ACE Renderers have thread unsafe instance field

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ACE

      Description

      As reported in the forum, these renderers use instance fields that they read from and write to during rendering:

      - TextAreaEntryRenderer
      - SliderEntryRenderer
      - PanelRenderer
      - DateTimeEntryRenderer
      - CheckboxButtonRenderer
      - CellEditorRenderer

      A common pattern found in some of them is to use this code:

      public class DateTimeEntryRenderer extends InputRenderer {
          private Map<String, Object> domUpdateMap = new HashMap<String, Object>();

      Which involves the encode methods using the domUpdateMap to create a hashcode. The domUpdateMap should be declared inside the methods, which might involve re-arranging code between the encodeBegin and encodeEnd methods.

      Renderers are application scoped, and can be used simultaneously by different requests / lifecycles. They should never use instance fields that are written to and then read from during a discrete render, since the same Renderer instance is used across threads for different views and users.

      We'll need to audit all of our ACE Renderers, as the forum posting might not have been comprehensive.

        Activity

        Mark Collette created issue -
        Mark Collette made changes -
        Field Original Value New Value
        Description As reported in the forum, these renderers

        - TextAreaEntryRenderer
        - SliderEntryRenderer
        - PanelRenderer
        - DateTimeEntryRenderer
        - CheckboxButtonRenderer
        - CellEditorRenderer

        Use this code:

        public class DateTimeEntryRenderer extends InputRenderer {
            private Map<String, Object> domUpdateMap = new HashMap<String, Object>();

        Which involves the encode methods using the domUpdateMap to create a hashcode. The domUpdateMap should be declared inside the methods, which might involve re-arranging code between the encodeBegin and encodeEnd methods.

        Renderers are application scoped, and can be used simultaneously by different requests / lifecycles. They should never use instance fields.
        As reported in the forum, these renderers

        - TextAreaEntryRenderer
        - SliderEntryRenderer
        - PanelRenderer
        - DateTimeEntryRenderer
        - CheckboxButtonRenderer
        - CellEditorRenderer

        Use this code:

        public class DateTimeEntryRenderer extends InputRenderer {
            private Map<String, Object> domUpdateMap = new HashMap<String, Object>();

        Which involves the encode methods using the domUpdateMap to create a hashcode. The domUpdateMap should be declared inside the methods, which might involve re-arranging code between the encodeBegin and encodeEnd methods.

        Renderers are application scoped, and can be used simultaneously by different requests / lifecycles. They should never use instance fields.

        We'll need to audit all of our ACE Renderers, as the forum posting might not have been comprehensive.
        Mark Collette made changes -
        Description As reported in the forum, these renderers

        - TextAreaEntryRenderer
        - SliderEntryRenderer
        - PanelRenderer
        - DateTimeEntryRenderer
        - CheckboxButtonRenderer
        - CellEditorRenderer

        Use this code:

        public class DateTimeEntryRenderer extends InputRenderer {
            private Map<String, Object> domUpdateMap = new HashMap<String, Object>();

        Which involves the encode methods using the domUpdateMap to create a hashcode. The domUpdateMap should be declared inside the methods, which might involve re-arranging code between the encodeBegin and encodeEnd methods.

        Renderers are application scoped, and can be used simultaneously by different requests / lifecycles. They should never use instance fields.

        We'll need to audit all of our ACE Renderers, as the forum posting might not have been comprehensive.
        As reported in the forum, these renderers use instance fields that they read from and write to during rendering:

        - TextAreaEntryRenderer
        - SliderEntryRenderer
        - PanelRenderer
        - DateTimeEntryRenderer
        - CheckboxButtonRenderer
        - CellEditorRenderer

        A common pattern found in some of them is to use this code:

        public class DateTimeEntryRenderer extends InputRenderer {
            private Map<String, Object> domUpdateMap = new HashMap<String, Object>();

        Which involves the encode methods using the domUpdateMap to create a hashcode. The domUpdateMap should be declared inside the methods, which might involve re-arranging code between the encodeBegin and encodeEnd methods.

        Renderers are application scoped, and can be used simultaneously by different requests / lifecycles. They should never use instance fields that are written to and then read from during a discrete render, since the same Renderer instance is used across threads for different views and users.

        We'll need to audit all of our ACE Renderers, as the forum posting might not have been comprehensive.
        Mark Collette made changes -
        Assignee Priority P1 [ 10010 ]
        Mark Collette made changes -
        Assignee Ken Fyten [ ken.fyten ]
        Ken Fyten made changes -
        Assignee Ken Fyten [ ken.fyten ] Nils Lundquist [ nils.lundquist ]
        Affects Version/s 3.3 [ 10370 ]
        Nils Lundquist made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 4.0 [ 11382 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Nils Lundquist
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: