Grails
  1. Grails
  2. GRAILS-1698

get'ers on controllers are called several times per request

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 1.0-RC2
    • Component/s: Controllers
    • Labels:
      None

      Description

      In my controllers I have several methods that look like get'ers. Some marked protected, some private. These are internal to the functioning of the controller and are sometimes expensive if they go to the database. I've found that grails will internally invoke these a couple times on its own. It turns out that
      DefaultGrailsController.java makes a couple invocations to DefaultGroovyMethods.getProperties(controller) which will invoke the get'ers to get the values. However, DefaultGrailsController doesn't need the values, it just wants the names.

        Activity

        Hide
        David Smiley added a comment -

        FYI http://jira.codehaus.org/browse/GROOVY-1875
        Though this doesn't absolve grails from calling getters when it doesn't need the value

        Show
        David Smiley added a comment - FYI http://jira.codehaus.org/browse/GROOVY-1875 Though this doesn't absolve grails from calling getters when it doesn't need the value

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            David Smiley
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development