2
votes

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?

1
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

1 Answers

0
votes

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.