ICEfaces
  1. ICEfaces
  2. ICE-3052

Multiple custom charts on same page are duplicated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All

      Description

      When multiple custom charts are displayed on the page randomly they will be duplicated. For example, we have three charts, chartA, chartB, and chartC. When the charts are updated by the renderOnSubmit attribute sometimes chartA will be displayed where chartB is and also be displayed where chartA is supposed to be shown. In some cases chartB is show where chartB should be and where chartC is. This occurs in a random order and is not predictable. The src path for the rendered img tag is the same when this issue occurs. Attached is a test case and screen shots that show the issue occurring. This issue does not occur using 1.6.2 and is only seen in 1.7.0 jars.

        Activity

        Hide
        Ken Fyten added a comment -

        Please try to reproduce this issue, Arran claims he can consistently, if necessary go see Arran.

        Show
        Ken Fyten added a comment - Please try to reproduce this issue, Arran claims he can consistently, if necessary go see Arran.
        Hide
        yip.ng added a comment -

        Can't reproduce problem, no matter how many times I reload the page or press the reset button. See screenshot-1.

        Show
        yip.ng added a comment - Can't reproduce problem, no matter how many times I reload the page or press the reset button. See screenshot-1.
        Hide
        yip.ng added a comment -

        With the exact same war file, the problem occurs on Arran's machine but not mine. We have the same versions of JDK and Tomcat. The only thing different is the OS. Strange!

        Show
        yip.ng added a comment - With the exact same war file, the problem occurs on Arran's machine but not mine. We have the same versions of JDK and Tomcat. The only thing different is the OS. Strange!
        Hide
        yip.ng added a comment -

        I think the problem is in com.icesoft.faces.component.outputchart.ChartResource#calculateDigest. It is using System.currentTimeMillis() to try to generate a unique number. The resource registry must be using this number to generate the resource name. The problem is that System.currentTimeMillis() can potentially generate duplicate numbers if the machine system time doesn't have enough granularity. Need to find another way to generate a unique number.

        Show
        yip.ng added a comment - I think the problem is in com.icesoft.faces.component.outputchart.ChartResource#calculateDigest. It is using System.currentTimeMillis() to try to generate a unique number. The resource registry must be using this number to generate the resource name. The problem is that System.currentTimeMillis() can potentially generate duplicate numbers if the machine system time doesn't have enough granularity. Need to find another way to generate a unique number.
        Hide
        yip.ng added a comment -

        Here is what the Java API doc has to say about currentTimeMillis():

        Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.

        Show
        yip.ng added a comment - Here is what the Java API doc has to say about currentTimeMillis(): Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.

          People

          • Assignee:
            Unassigned
            Reporter:
            Arran McCullough
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: