@Override public boolean isSecondLevelCacheEnabled() { return delegate.isSecondLevelCacheEnabled(); }
public boolean isSecondLevelCacheEnabled() { return sessionFactoryOptions.isSecondLevelCacheEnabled(); }
@Override public CacheRegionStatisticsImpl getCacheRegionStatistics(String regionName) { if ( sessionFactory == null ) { return null; } if ( ! sessionFactory.getSessionFactoryOptions().isSecondLevelCacheEnabled() ) { return null; } return l2CacheStatsMap.computeIfAbsent( regionName, s -> { Region region = sessionFactory.getCache().getRegion( regionName ); if ( region == null ) { // this is the pre-5.3 behavior. and since this is a pre-5.3 method it should behave consistently // NOTE that this method is deprecated region = sessionFactory.getCache().getQueryResultsCache( regionName ).getRegion(); } return new CacheRegionStatisticsImpl( region ); } ); }
private void integrate(SessionFactoryServiceRegistry serviceRegistry, SessionFactoryImplementor sessionFactory) { if ( !sessionFactory.getSessionFactoryOptions().isAutoEvictCollectionCache() ) { // feature is disabled return; } if ( !sessionFactory.getSessionFactoryOptions().isSecondLevelCacheEnabled() ) { // Nothing to do, if caching is disabled return; } EventListenerRegistry eventListenerRegistry = serviceRegistry.getService( EventListenerRegistry.class ); eventListenerRegistry.appendListeners( EventType.POST_INSERT, this ); eventListenerRegistry.appendListeners( EventType.POST_DELETE, this ); eventListenerRegistry.appendListeners( EventType.POST_UPDATE, this ); }
if ( creationContext.getSessionFactory().getSessionFactoryOptions().isSecondLevelCacheEnabled() ) { this.canWriteToCache = determineCanWriteToCache( persistentClass, cacheAccessStrategy ); this.canReadFromCache = determineCanReadFromCache( persistentClass, cacheAccessStrategy ); if ( creationContext.getSessionFactory().getSessionFactoryOptions().isSecondLevelCacheEnabled() ) { this.invalidateCache = canWriteToCache && determineWhetherToInvalidateCache( persistentClass, creationContext );
@Override public boolean isSecondLevelCacheEnabled() { return delegate.isSecondLevelCacheEnabled(); }
public boolean isSecondLevelCacheEnabled() { return sessionFactoryOptions.isSecondLevelCacheEnabled(); }
LOG.debugf( "Named query checking : %s", enabledDisabled( sessionFactoryOptions.isNamedQueryStartupCheckingEnabled() ) ); LOG.debugf( "Second-level cache: %s", enabledDisabled( sessionFactoryOptions.isSecondLevelCacheEnabled() ) ); LOG.debugf( "Second-level query cache: %s", enabledDisabled( sessionFactoryOptions.isQueryCacheEnabled() ) ); LOG.debugf( "Second-level query cache factory: %s", sessionFactoryOptions.getTimestampsCacheFactory() );
@Override public CacheRegionStatisticsImpl getCacheRegionStatistics(String regionName) { if ( sessionFactory == null ) { return null; } if ( ! sessionFactory.getSessionFactoryOptions().isSecondLevelCacheEnabled() ) { return null; } return l2CacheStatsMap.computeIfAbsent( regionName, s -> { Region region = sessionFactory.getCache().getRegion( regionName ); if ( region == null ) { // this is the pre-5.3 behavior. and since this is a pre-5.3 method it should behave consistently // NOTE that this method is deprecated region = sessionFactory.getCache().getQueryResultsCache( regionName ).getRegion(); } return new CacheRegionStatisticsImpl( region ); } ); }
private void integrate(SessionFactoryServiceRegistry serviceRegistry, SessionFactoryImplementor sessionFactory) { if ( !sessionFactory.getSessionFactoryOptions().isAutoEvictCollectionCache() ) { // feature is disabled return; } if ( !sessionFactory.getSessionFactoryOptions().isSecondLevelCacheEnabled() ) { // Nothing to do, if caching is disabled return; } EventListenerRegistry eventListenerRegistry = serviceRegistry.getService( EventListenerRegistry.class ); eventListenerRegistry.appendListeners( EventType.POST_INSERT, this ); eventListenerRegistry.appendListeners( EventType.POST_DELETE, this ); eventListenerRegistry.appendListeners( EventType.POST_UPDATE, this ); }
this.dialect = factory.getServiceRegistry().getService( JdbcServices.class ).getDialect(); if ( creationContext.getSessionFactory().getSessionFactoryOptions().isSecondLevelCacheEnabled() ) { PersistentClass persistentClass = (PersistentClass) bootMapping; this.canWriteToCache = persistentClass.isCached();
LOG.debugf( "Named query checking : %s", enabledDisabled( sessionFactoryOptions.isNamedQueryStartupCheckingEnabled() ) ); LOG.debugf( "Second-level cache: %s", enabledDisabled( sessionFactoryOptions.isSecondLevelCacheEnabled() ) ); LOG.debugf( "Second-level query cache: %s", enabledDisabled( sessionFactoryOptions.isQueryCacheEnabled() ) ); LOG.debugf( "Second-level query cache factory: %s", sessionFactoryOptions.getTimestampsCacheFactory() );