Grails
  1. Grails
  2. GRAILS-8558

Where queries doesn't work on bootstrap.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0 final
    • Fix Version/s: 2.0.1, 2.1-RC1
    • Component/s: Persistence
    • Labels:
    • Environment:
      Linux mint 12, jdk version 6.26-1linuxmint1. But I've seen the error even in windows platform.

      Description

      Where queries doesn't work correctly on bootstrap. The first query return 3 results, the second only one result.

      Domain class:
      class User {
      String name
      static constraints = {
      }
      }

      BootStrap class

      class BootStrap {

      def init = { servletContext ->

      new User(name: "tito").save(flush: true)
      new User(name: "neto").save(flush: true)
      new User(name: "lalo").save(flush: true)

      def query1 = User.where

      { name == "tito" }

      .findAll()

      def query2 = User.findAllByName("tito")
      log.info "Size query 1: " + query1.size()
      log.info "Size query 2: " + query2.size()

      }
      def destroy = {
      }
      }

        Activity

        Show
        Graeme Rocher added a comment - Fixed by https://github.com/SpringSource/grails-data-mapping/commit/d241464fbbd49455504bc9ed125a314f41e38a06

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development