Clear EntityMangerFactory cache when creating EntityManager
@@ -68,6 +68,8 @@ public class AppCatalogJPAUtils {
properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=31536000, autoReconnect=true");
factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
}
+ // clear cache at entitymangerfactory level
+ factory.getCache().evictAll();
appCatEntityManager = factory.createEntityManager();
return appCatEntityManager;
}
