You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by "Trevor Mack (JIRA)" <ji...@apache.org> on 2013/01/18 21:36:12 UTC

[jira] [Created] (RAVE-876) Change to fetch Collections on JpaWidget lazily instead of eagerly.

Trevor Mack created RAVE-876:
--------------------------------

             Summary: Change to fetch Collections on JpaWidget lazily instead of eagerly.
                 Key: RAVE-876
                 URL: https://issues.apache.org/jira/browse/RAVE-876
             Project: Rave
          Issue Type: Improvement
          Components: rave-jpa
            Reporter: Trevor Mack
            Priority: Trivial


On page load there are a number of objects that get populated (either from cache, if implemented, or via database provider) for the @JoinColumn attributes on a JPAWidget because FetchType is set to EAGER.

For a vanilla instance of Rave this is overly excessive since the Widget in order to render doesn't require Ratings, Comments, Tags, or Categories this should be set to FetchType.LAZY to allow the JPA provider the ability to add efficiency in the server's time rendering the base page layout / html.

---------------------- initial email contents ----------------------

I have been spending sometime in looking at the effecency of a RAVE extension and discovered that on initial page load (and every page load after that) there is some excessive database / cache calls being made to populate the model. Taking a look at the JPA configuration I pinned it down to how OpenJPA is creating the JpaWidget model as there are a number of parameters being fetched, though never used the following list shows this:

- List<JpaWidgetComment> comments (ln #184)
- List<JpaWidgetRating> ratings (ln #202)
- List<JpaWidgetTag> tags (ln #206)
- List<JpaCategory> categories (ln #214)

These attributes are only displayed within the store and IMHO are not needed to be EAGERLY fetched. Changing this to the more common FetchType.LAZY. The default usually is to load Collections lazily while loading attributes eagerly. [1]

If there aren't any objections I am going to submit a patch this afternoon, created a ticket within JIRA (my first contribution to RAVE!)


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira