#703 - Refactor - When batch lazy loading hits the L2 bean cache and misses initially, it checks that initial bean again (and should skip the second attempt)

This commit is contained in:
Robin Bygrave committed 2016-05-13 14:12:28 +12:00
1 parent 0e5859716b
commit e344b5c0a1
1 file changed
+3 -1
@@ -185,7 +185,9 @@ public class DLoadBeanContext extends DLoadBaseContext implements LoadBeanContex
// check each of the beans in the batch to see if they are in the L2 cache.
Iterator<EntityBeanIntercept> iterator = list.iterator();
while (iterator.hasNext()) {
if (context.desc.cacheBeanLoad(iterator.next(), persistenceContext)) {
EntityBeanIntercept batchEbi = iterator.next();
if (batchEbi != ebi && context.desc.cacheBeanLoad(batchEbi, persistenceContext)) {
// bean successfully loaded from L2 cache so remove from batch load
iterator.remove();
}
}