private void createDomainCache() { Configuration conf = makeRequiredConfiguration(); logger.debug("Configuration for {} is: {}", DOMAIN_CACHE_NAME, conf.toString()); this.cacheManager.defineConfiguration(DOMAIN_CACHE_NAME, conf); final DefaultCacheManager finalCacheManager = this.cacheManager; this.domainCache = doWithinBackingTransactionIfNeeded(new Callable<Cache<String, DataVersionHolder>>() { @Override public Cache<String, DataVersionHolder> call() { return finalCacheManager.getCache(DOMAIN_CACHE_NAME); } }); }
private void createSystemCache() { Configuration conf = makeRequiredConfiguration(); logger.debug("Configuration for {} is: {}", SYSTEM_CACHE_NAME, conf.toString()); this.cacheManager.defineConfiguration(SYSTEM_CACHE_NAME, conf); final DefaultCacheManager finalCacheManager = this.cacheManager; this.systemCache = doWithinBackingTransactionIfNeeded(new Callable<Cache<String, Object>>() { @Override public Cache<String, Object> call() { return finalCacheManager.getCache(SYSTEM_CACHE_NAME); } }); }
private Result cacheInfo(Session session) { Cache<?, ?> cache = session.getCache(cacheName); Configuration cacheConfiguration = cache.getCacheConfiguration(); return new StringResult(cacheConfiguration.toString()); } }
private Result cacheInfo(Session session) { Cache<?, ?> cache = session.getCache(cacheName); Configuration cacheConfiguration = cache.getCacheConfiguration(); return new StringResult(cacheConfiguration.toString()); } }
private void createCache() { Configuration conf = makeRequiredConfiguration(); logger.debug("Configuration for {} is: {}", CACHE_NAME, conf.toString()); this.cacheManager.defineConfiguration(CACHE_NAME, conf); this.cache = this.cacheManager.getCache(CACHE_NAME).getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES); // final DefaultCacheManager finalCacheManager = this.cacheManager; // this.cache = doWithinBackingTransactionIfNeeded(new Callable<Cache<Object, Object>>() { // @Override // public Cache<Object, Object> call() { // return finalCacheManager.getCache(CACHE_NAME).getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES); // } // }); }
private void initTransactionManager() { Configuration conf = makeRequiredConfiguration(); // for the dummy cache disable, cache loaders if any was configured ConfigurationBuilder confBuilder = new ConfigurationBuilder().read(conf); confBuilder.loaders().clearCacheLoaders(); conf = confBuilder.build(); String DUMMY_CACHE = "dummy-cache"; logger.debug("Configuration for {} is: {}", DUMMY_CACHE, conf.toString()); try { this.cacheManager.defineConfiguration(DUMMY_CACHE, conf); Cache<?, ?> dummyCache = this.cacheManager.getCache(DUMMY_CACHE); TransactionManager tm = dummyCache.getAdvancedCache().getTransactionManager(); this.transactionManager = tm; } catch (Exception e) { logger.error("Failed to get Repository TransactionManager", e); throw new PersistenceException(e); } }
private void initTransactionManager() { Configuration conf = makeRequiredConfiguration(); // for the dummy cache disable, cache loaders if any was configured ConfigurationBuilder confBuilder = new ConfigurationBuilder().read(conf); confBuilder.loaders().clearCacheLoaders(); conf = confBuilder.build(); String DUMMY_CACHE = "dummy-cache"; logger.debug("Configuration for {} is: {}", DUMMY_CACHE, conf.toString()); try { this.cacheManager.defineConfiguration(DUMMY_CACHE, conf); Cache<?, ?> dummyCache = this.cacheManager.getCache(DUMMY_CACHE); TransactionManager tm = dummyCache.getAdvancedCache().getTransactionManager(); this.transactionManager = tm; } catch (Exception e) { logger.error("Failed to get Repository TransactionManager", e); throw new PersistenceException(e); } }