Противоречивые записи, связанные с кэшированием в журналах приложений

Я расследую проблему кеширования и обнаружил что-то странное в журналах приложений.

Там есть IllegalStateException говорят, что "Кэш не жив (STATUS_SHUTDOWN)" (неудачный запрос выбора), сразу после чего выводится статистика Hibernate, сообщая, что Hibernate выполнил "1 L2C put". Разве операция кэша не должна завершиться ошибкой, когда соответствующий запрос на выборку завершился неудачей из-за того, что "кэш не активен"?

Но в следующем фрагменте журнала я вижу эти две противоречивые записи:

// ... hibernate select query here
SEVERE: Exception was caught by a GlobalLocalizedExceptionHandler
java.lang.IllegalStateException: The region Cache is not alive (STATUS_SHUTDOWN)
    at net.sf.ehcache.Cache$CacheStatus.checkAlive(Cache.java:4105)
    at net.sf.ehcache.Cache.checkStatus(Cache.java:2796)
    at net.sf.ehcache.Cache.get(Cache.java:1744)
    at org.hibernate.cache.ehcache.internal.regions.EhcacheTransactionalDataRegion.get(EhcacheTransactionalDataRegion.java:112)
    at org.hibernate.cache.ehcache.internal.strategy.AbstractReadWriteEhcacheAccessStrategy.putFromLoad(AbstractReadWriteEhcacheAccessStrategy.java:111)
    at org.hibernate.cache.ehcache.internal.nonstop.NonstopAwareEntityRegionAccessStrategy.putFromLoad(NonstopAwareEntityRegionAccessStrategy.java:153)
    at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:221)
    at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:144)
    at org.hibernate.loader.plan.exec.process.internal.AbstractRowReader.performTwoPhaseLoad(AbstractRowReader.java:244)
    at org.hibernate.loader.plan.exec.process.internal.AbstractRowReader.finishUp(AbstractRowReader.java:215)
    at org.hibernate.loader.plan.exec.process.internal.ResultSetProcessorImpl.extractResults(ResultSetProcessorImpl.java:140)
    at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:138)
    at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:102)
    at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:186)
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4126)
    at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:503)
    at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:468)
    at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:213)
    at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:146)
    at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1106)
    at org.hibernate.internal.SessionImpl.immediateLoad(SessionImpl.java:1012)
    at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:174)
    at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:286)
    at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:185)
    ... (other stack frames are omitted)
Mar 26, 2018 9:27:59 AM org.hibernate.engine.internal.StatisticalLoggingSessionEventListener end
INFO: Session Metrics {
    795143 nanoseconds spent acquiring 1 JDBC connections;
    0 nanoseconds spent releasing 0 JDBC connections;
    296616 nanoseconds spent preparing 1 JDBC statements;
    3518392 nanoseconds spent executing 1 JDBC statements;
    0 nanoseconds spent executing 0 JDBC batches;
    157908 nanoseconds spent performing 1 L2C puts;
    0 nanoseconds spent performing 0 L2C hits;
    0 nanoseconds spent performing 0 L2C misses;
    0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections);
    0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
}

Зависимости (отфильтрованные по mvn dependency:tree '-Dincludes=*:*cache*'):

[INFO] ------------< com.company.app:web-app >------------
[INFO] Building web-app 1.0-SNAPSHOT                                   [4/7]
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ web-app ---
[INFO] com.company.app:web-app:war:1.0-SNAPSHOT
[INFO] +- com.company.app:app-core:jar:1.0-SNAPSHOT:compile
[INFO] |  +- net.sf.ehcache:ehcache:jar:2.10.4:compile
[INFO] |  \- org.hibernate:hibernate-ehcache:jar:4.3.11.Final:compile
[INFO] \- org.apache.cxf:cxf-rt-ws-security:jar:2.6.4:compile
[INFO]    \- net.sf.ehcache:ehcache-core:jar:2.5.1:compile

0 ответов

Другие вопросы по тегам