Fixed
Details
Assignee
Steve EbersoleSteve EbersoleReporter
amit bhayaniamit bhayaniComponents
Fix versions
Priority
Minor
Details
Details
Assignee
Steve Ebersole
Steve EbersoleReporter
amit bhayani
amit bhayaniComponents
Fix versions
Priority
Created June 12, 2006 at 7:32 AM
Updated June 15, 2006 at 6:42 PM
Resolved June 15, 2006 at 6:42 PM
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.