2

I have the domain classes:

class Person {
    static hasMany = [ items: Item ]
    static fetchMode = [ items: 'eager'  ]
    String name
    Set items
}
class Item {
    static belongsTo = [ owner: Person ]
    String name
}

If I leave static fetchMode = [ items: 'eager' ] in place, then calling getItems() only returns about 10% of the items. If I remove the fetchMode, then getItems() returns all the items. Any idea why eager fetch results in retrieving less than all the stored data?

Tim Post
  • 33,371
  • 15
  • 110
  • 174
Steve Kuo
  • 61,876
  • 75
  • 195
  • 257
  • Please share the answer to your question as an _answer_ and then accept the answer, otherwise this question will continue to linger in our 'Unanswered Questions' list. If the question is no longer relevant, please flag it for moderator attention. – Tim Post Feb 23 '11 at 07:21

1 Answers1

0

In February 2011, this had been identified as a bug in Grails 1.04, according to grails.org. As of July 2012, the bug is listed as closed, so the problem should be resolved.

Ricardo Altamirano
  • 14,650
  • 21
  • 72
  • 105
  • See [this question](http://meta.stackexchange.com/questions/139075/should-old-questions-with-a-solution-in-the-comments-but-no-posted-answer-be-ans) for why I'm answering an old post. – Ricardo Altamirano Jul 11 '12 at 02:05