Tapestry
  1. Tapestry
  2. TAPESTRY-2245

GridDataSource getAvailableRows() method called inefficiently

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.11
    • Fix Version/s: 5.0.11
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      The getAvailableRows() method is called multiple times while rendering the page. This is fine when it is just invoking size() on a List, but for a Hibernate query it is quite inefficient:

      [INFO] AppModule.TimingFilter Request time: 1 ms
      Hibernate:
      select
      count(account0_.ACCOUNT_ID) as col_0_0_
      from
      ACCOUNT account0_
      Hibernate:
      select
      this_.ACCOUNT_ID as ACCOUNT1_0_0_,
      this_.FIRST_NAME as FIRST2_0_0_,
      this_.LAST_NAME as LAST3_0_0_,
      this_.PASSWORD as PASSWORD0_0_,
      this_.DATE_OF_BIRTH as DATE5_0_0_,
      this_.COMMENTS as COMMENTS0_0_
      from
      ACCOUNT this_
      Hibernate:
      select
      count(account0_.ACCOUNT_ID) as col_0_0_
      from
      ACCOUNT account0_
      Hibernate:
      select
      count(account0_.ACCOUNT_ID) as col_0_0_
      from
      ACCOUNT account0_
      Hibernate:
      select
      count(account0_.ACCOUNT_ID) as col_0_0_
      from
      ACCOUNT account0_
      Hibernate:
      select
      count(account0_.ACCOUNT_ID) as col_0_0_
      from
      ACCOUNT account0_
      [INFO] AppModule.TimingFilter Request time: 147 ms
      [INFO] AppModule.TimingFilter Request time: 0 ms
      [INFO] AppModule.TimingFilter Request time: 0 ms

      Some care should be taken to ensure that the method is invoked once per request and the value cached.

        Activity

        Howard M. Lewis Ship created issue -
        Hide
        Kevin Menard added a comment -

        Maybe an application for the new @Once annotation.

        Show
        Kevin Menard added a comment - Maybe an application for the new @Once annotation.
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 5.0.11 [ 12312968 ]
        Resolution Fixed [ 1 ]
        Assignee Howard M. Lewis Ship [ hlship ]
        Mark Thomas made changes -
        Workflow jira [ 12425575 ] Default workflow, editable Closed status [ 12569377 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12569377 ] jira [ 12590635 ]

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development