Associations are not lazy by default!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Associations are not lazy by default!

rosenfeld
While developing a batch processing procedure, I was trying to
understand why it was so slow.

After looking at the MySql queries log, I've seen lots of queries that
shouldn't be required.

The Grails documentation states that all associations are lazy by
default, unless specified otherwise.

I didn't specify for my classes, but it was fetching data from a
has-many association. When I explicitly set "lazy: true" to my hasMany
association, the queries were not being performed anymore.

Has this behavior changed in recent Grails releases and the
documentation hasn't been updated?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Associations are not lazy by default!

burtbeckwith
No, nothing has changed. Please create a JIRA issue with a simple example demonstrating the problem. Run 'grails bug-report' on the sample app and attach the generated zip to the report.

Burt

On Friday, February 24, 2012 12:55:32 PM Rodrigo Rosenfeld Rosas wrote:

> While developing a batch processing procedure, I was trying to
> understand why it was so slow.
>
> After looking at the MySql queries log, I've seen lots of queries that
> shouldn't be required.
>
> The Grails documentation states that all associations are lazy by
> default, unless specified otherwise.
>
> I didn't specify for my classes, but it was fetching data from a
> has-many association. When I explicitly set "lazy: true" to my hasMany
> association, the queries were not being performed anymore.
>
> Has this behavior changed in recent Grails releases and the
> documentation hasn't been updated?


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Associations are not lazy by default!

rosenfeld
Here it is:

http://jira.grails.org/browse/GRAILS-8842

Thanks for taking a look,
Rodrigo.

Em 24-02-2012 13:32, Burt Beckwith escreveu:
No, nothing has changed. Please create a JIRA issue with a simple example demonstrating the problem. Run 'grails bug-report' on the sample app and attach the generated zip to the report.

Burt

On Friday, February 24, 2012 12:55:32 PM Rodrigo Rosenfeld Rosas wrote:
While developing a batch processing procedure, I was trying to 
understand why it was so slow.

After looking at the MySql queries log, I've seen lots of queries that 
shouldn't be required.

The Grails documentation states that all associations are lazy by 
default, unless specified otherwise.

I didn't specify for my classes, but it was fetching data from a 
has-many association. When I explicitly set "lazy: true" to my hasMany 
association, the queries were not being performed anymore.

Has this behavior changed in recent Grails releases and the 
documentation hasn't been updated?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: Associations are not lazy by default!

rosenfeld
Nevermind, please close the ticket.

Thanks,
Rodrigo.

Em 25-02-2012 12:15, Rodrigo Rosenfeld Rosas escreveu:
Here it is:

http://jira.grails.org/browse/GRAILS-8842

Thanks for taking a look,
Rodrigo.

Em 24-02-2012 13:32, Burt Beckwith escreveu:
No, nothing has changed. Please create a JIRA issue with a simple example demonstrating the problem. Run 'grails bug-report' on the sample app and attach the generated zip to the report.

Burt

On Friday, February 24, 2012 12:55:32 PM Rodrigo Rosenfeld Rosas wrote:
While developing a batch processing procedure, I was trying to 
understand why it was so slow.

After looking at the MySql queries log, I've seen lots of queries that 
shouldn't be required.

The Grails documentation states that all associations are lazy by 
default, unless specified otherwise.

I didn't specify for my classes, but it was fetching data from a 
has-many association. When I explicitly set "lazy: true" to my hasMany 
association, the queries were not being performed anymore.

Has this behavior changed in recent Grails releases and the 
documentation hasn't been updated?
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email