[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1831?page=all ]
Steve Ebersole closed HHH-1831:
-------------------------------
Fix Version: 3.2.0
Resolution: Fixed
Assign To: Steve Ebersole
Not quite the correct solution. TheRightThing is to modify ManyToOneType to have it make sure it should be adding something to the batcj fetch queue before it actually does. Adding that check in BatchFetchQueue.addBatchLoadableEntityKey() acutally causes unnecessary overhead to the other current caller of that method: DefaultLoadEventListener, where we already know for a fact that the entity is not associated with the session.
Added the necessary changes to ManyToOneType
> Batch loading the same EntityKey (one side of manytoone ) more than once
> ------------------------------------------------------------------------
>
> Key: HHH-1831
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1831
> Project: Hibernate3
> Type: Improvement
> Components: core
> Versions: 3.1.1, 3.1.2, 3.1.3
> Reporter: amit bhayani
> Assignee: Steve Ebersole
> Priority: Minor
> Fix For: 3.2.0
>
>
> Within the same session, the same entity gets batch loaded multiple times. The ManyToOneType.scheduleBatchLoad calls BatchFetchQueue.addBatchLoadableEntityKey without checking to see if the entity already exists with the current PersistanceContext. Adding the extra condition "!context.containsEntity(key)" to the BatchFetchQueue.addBatchLoadableEntityKey method which seems to address the issue.
> public void addBatchLoadableEntityKey(EntityKey key) {
> if ( key.isBatchLoadable() && !context.containsEntity(key) ) {
> batchLoadableEntityKeys.put(key, MARKER);
> }
> }
> This will save few loops if we have large set of Entity being lodaded with each of them having manytoone relationship with other Entity.
--
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
|