use of org.hibernate.cache.spi.access.AccessType in project hibernate-orm by hibernate.
the class AbstractNonFunctionalTest method getCacheModeParameters.
@CustomParameterized.Order(1)
@Parameterized.Parameters(name = "{2},{3}")
public List<Object[]> getCacheModeParameters() {
ArrayList<Object[]> modes = new ArrayList<>();
for (AccessType accessType : new AccessType[] { AccessType.TRANSACTIONAL, AccessType.READ_ONLY, AccessType.READ_WRITE }) {
modes.add(new Object[] { CacheMode.INVALIDATION_SYNC, accessType });
}
for (AccessType accessType : new AccessType[] { AccessType.READ_ONLY, AccessType.READ_WRITE, AccessType.NONSTRICT_READ_WRITE }) {
modes.add(new Object[] { CacheMode.REPL_SYNC, accessType });
modes.add(new Object[] { CacheMode.DIST_SYNC, accessType });
if (canUseLocalMode()) {
modes.add(new Object[] { CacheMode.LOCAL, accessType });
}
}
if (canUseLocalMode()) {
modes.add(new Object[] { CacheMode.LOCAL, AccessType.TRANSACTIONAL });
}
return modes;
}
use of org.hibernate.cache.spi.access.AccessType in project hibernate-orm by hibernate.
the class CacheImpl method determineCollectionRegionAccessStrategy.
@Override
public CollectionRegionAccessStrategy determineCollectionRegionAccessStrategy(Collection model) {
final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
CollectionRegionAccessStrategy accessStrategy = collectionRegionAccessStrategyMap.get(cacheRegionName);
if (accessStrategy == null && settings.isSecondLevelCacheEnabled()) {
final AccessType accessType = AccessType.fromExternalName(model.getCacheConcurrencyStrategy());
if (accessType != null) {
LOG.tracev("Building shared cache region for collection data [{0}]", model.getRole());
CollectionRegion collectionRegion = regionFactory.buildCollectionRegion(cacheRegionName, sessionFactory.getProperties(), CacheDataDescriptionImpl.decode(model));
accessStrategy = collectionRegion.buildAccessStrategy(accessType);
collectionRegionAccessStrategyMap.put(cacheRegionName, accessStrategy);
}
}
return accessStrategy;
}
Aggregations