From: amit b. (JIRA) <no...@at...> - 2006-06-12 05:32:34
|
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 Priority: Minor 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 |