[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5187) Allow some control over whether or not an association is loaded via a join on the merge path

Emmanuel Bernard (JIRA) noreply at atlassian.com
Mon May 3 12:48:28 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36860#action_36860 ] 

Emmanuel Bernard commented on HHH-5187:
---------------------------------------

Today to merge an object graph, we load the object graph following the MERGE cascade settings allowing 1 query instead of multiple. This works well most of the time but can be surprising if the user expects lazy associations to not be loaded and if their side-effect loads triggers a performance hit.

We can add a mapping to control this 

{code}@SkipJoinLoadOn({MERGE, REFRESH}){code}

REFRESH and MERGE using the same algorithm.

Note that the current algorithm is best most of the time:
 - it reduces the number of queries needed to merge an object graph
 - it limit the number of prepared queries (and thus memory consumption) Hibernate needs to keep (*)

(*) if we load only associations marked as MERGE and not LAZY we need to create and keep :
 - two different queries assuming one association, 
 - four different queries assuming two associations,  
etc... This is not realistic.

> Allow some control over whether or not an association is loaded via a join on the merge path
> --------------------------------------------------------------------------------------------
>
>                 Key: HHH-5187
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5187
>             Project: Hibernate Core
>          Issue Type: New Feature
>          Components: core
>            Reporter: Emmanuel Bernard
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list