public NaturalIdCleanup( NaturalIdDataAccess naturalIdCacheAccessStrategy, SharedSessionContractImplementor session) { this.naturalIdCacheAccessStrategy = naturalIdCacheAccessStrategy; this.cacheLock = naturalIdCacheAccessStrategy.lockRegion(); naturalIdCacheAccessStrategy.removeAll( session ); }
private EntityCleanup( EntityDataAccess cacheAccess, SharedSessionContractImplementor session) { this.cacheAccess = cacheAccess; this.cacheLock = cacheAccess.lockRegion(); cacheAccess.removeAll( session ); }
private CollectionCleanup( CollectionDataAccess cacheAccess, SharedSessionContractImplementor session) { this.cacheAccess = cacheAccess; this.cacheLock = cacheAccess.lockRegion(); cacheAccess.removeAll( session ); }
public static String toXml(AccessType accessType) { return accessType.getExternalName(); } }
@Override public void clear() { for ( EntityDataAccess cacheAccess : entityDataAccessMap.values() ) { cacheAccess.evictAll(); } for ( NaturalIdDataAccess cacheAccess : naturalIdDataAccessMap.values() ) { cacheAccess.evictAll(); } for ( CollectionDataAccess cacheAccess : collectionDataAccessMap.values() ) { cacheAccess.evictAll(); } }
public static AccessType fromXml(String name) { return AccessType.fromExternalName( name ); }
@Override public void doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session) { final CollectionDataAccess cache = persister.getCacheAccessStrategy(); final Object ck = cache.generateCacheKey( key, persister, session.getFactory(), session.getTenantIdentifier() ); cache.unlockItem( session, ck, lock ); } }
protected final void evict() throws CacheException { if ( persister.hasCache() ) { final CollectionDataAccess cache = persister.getCacheAccessStrategy(); final Object ck = cache.generateCacheKey( key, persister, session.getFactory(), session.getTenantIdentifier() ); cache.remove( session, ck); } }
EntityStatisticsImpl(EntityPersister rootEntityDescriptor) { super( () -> rootEntityDescriptor.getCacheAccessStrategy() != null ? rootEntityDescriptor.getCacheAccessStrategy().getRegion() : null ); this.rootEntityName = rootEntityDescriptor.getRootEntityName(); }
private void release() { cacheAccess.unlockRegion( cacheLock ); } }
private void release() { cacheAccess.unlockRegion( cacheLock ); } }
private void release() { naturalIdCacheAccessStrategy.unlockRegion( cacheLock ); } }
CollectionStatisticsImpl(CollectionPersister persister) { super( () -> persister.getCacheAccessStrategy() != null ? persister.getCacheAccessStrategy().getRegion() : null ); this.collectionRole = persister.getRole(); }
private void evictEntityData(NavigableRole navigableRole, EntityDataAccess cacheAccess) { if ( cacheAccess == null ) { return; } if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting entity cache: %s", navigableRole.getFullPath() ); } cacheAccess.evictAll(); }
private void evictNaturalIdData(NavigableRole rootEntityRole, NaturalIdDataAccess cacheAccess) { if ( cacheAccess == null ) { return; } if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting natural-id cache: %s", rootEntityRole.getFullPath() ); } cacheAccess.evictAll(); }
private void evictCollectionData(NavigableRole navigableRole, CollectionDataAccess cacheAccess) { if ( cacheAccess == null ) { return; } if ( LOG.isDebugEnabled() ) { LOG.debugf( "Evicting second-level cache: %s", navigableRole.getFullPath() ); } cacheAccess.evictAll(); }
private static String resolveCacheConcurrencyStrategy(CacheConcurrencyStrategy strategy) { final org.hibernate.cache.spi.access.AccessType accessType = strategy.toAccessType(); return accessType == null ? null : accessType.getExternalName(); }
public void overlay(CacheRegionDefinition overrides) { if ( overrides == null ) { return; } requested = TruthValue.TRUE; accessType = AccessType.fromExternalName( overrides.getUsage() ); if ( StringHelper.isEmpty( overrides.getRegion() ) ) { region = overrides.getRegion(); } // ugh, primitive boolean cacheLazyProperties = overrides.isCacheLazy(); }
public static String getCacheConcurrencyStrategy(CacheConcurrencyStrategy strategy) { org.hibernate.cache.spi.access.AccessType accessType = strategy.toAccessType(); return accessType == null ? null : accessType.getExternalName(); }
private boolean isMatch(String name) { return ( accessType != null && accessType.getExternalName().equalsIgnoreCase( name ) ) || name().equalsIgnoreCase( name ); } }