From d67cbeb3f2e3c40bf44d5e6e659233dd9e767714 Mon Sep 17 00:00:00 2001 From: Redkale <22250530@qq.com> Date: Fri, 30 Mar 2018 17:42:18 +0800 Subject: [PATCH] --- src/org/redkale/source/EntityInfo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/redkale/source/EntityInfo.java b/src/org/redkale/source/EntityInfo.java index 936e4e823..7cb680804 100644 --- a/src/org/redkale/source/EntityInfo.java +++ b/src/org/redkale/source/EntityInfo.java @@ -142,16 +142,16 @@ public final class EntityInfo { static EntityInfo load(Class clazz, final boolean cacheForbidden, final Properties conf, DataSource source, BiFunction fullloader) { EntityInfo rs = entityInfos.get(clazz); - if (rs != null) return rs; + if (rs != null && (rs.cache == null || rs.cache.isFullLoaded())) return rs; synchronized (entityInfos) { rs = entityInfos.get(clazz); if (rs == null) { rs = new EntityInfo(clazz, cacheForbidden, conf, source, fullloader); + entityInfos.put(clazz, rs); if (rs.cache != null) { if (fullloader == null) throw new IllegalArgumentException(clazz.getName() + " auto loader is illegal"); rs.cache.fullLoad(); } - entityInfos.put(clazz, rs); } return rs; }