I have been spending sometime in looking at the efficiency 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]

I am going to submit a patch this afternoon to the ticket I created (RAVE-876) 
within JIRA (my first contribution to RAVE!) [2]

[1] http://java.dzone.com/articles/jpa-lazy-loading
[2] https://issues.apache.org/jira/browse/RAVE-876

--
Trevor Mack
Software Systems Engineer (R501), Apache Rave
Application Development and Maintenance (KICS), R501
MITRE K-building, 1K136 | (781) 271-7252 | [email protected]
twitter: @tmack8001 | g+: drummer8001 | github: tmack8001

Reply via email to