Hibernate和EHCache性能问题



我在启动应用程序时就开始遇到性能问题。我有冬眠5.2.7&ehcache 2.9.0。

您可以从日志中看到,需要24秒才能完全加载Hibernate配置:

19:29:16.446 INFO  - HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
19:29:17.770 WARN  - HHH90000021: Encountered deprecated setting [hibernate.ejb.interceptor], use [hibernate.session_factory.interceptor] instead
19:29:21.998 WARN  - No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:/C:/Users/admin/.gradle/caches/modules-2/files-2.1/net.sf.ehcache/ehcache/2.9.0/8a4f89d91daafb3994ed212201f935554a200b4b/ehcache-2.9.0.jar!/ehcache-failsafe.xml
19:29:25.285 WARN  - HHH020003: Could not find a specific ehcache configuration for cache named [org.Entity2]; using defaults.
19:29:28.652 WARN  - HHH020003: Could not find a specific ehcache configuration for cache named [org.Entity1]; using defaults.
19:29:35.952 WARN  - HHH020003: Could not find a specific ehcache configuration for cache named [org.Entity3]; using defaults.
19:29:35.958 WARN  - HHH020007: read-only cache configured for mutable entity [org.Entity3]
19:29:40.486 INFO  - HHH000397: Using ASTQueryTranslatorFactory

如果我将eHcache升级到2.10.3问题仍然复制。

您要做的第一件事似乎添加了一个ehcache.xml文件。理想情况下,配置了正确的缓存。看看它是否有帮助。

另外,我会怀疑updateCheck这是一个标志,告诉EHCACHE检查是否可用新版本。如果您无法访问Internet,它可能会超级慢。因此,将其设置为false在您的配置中。

最新更新