/** */ public CacheJdbcPojoStoreFactory getStoreFactory() { CacheJdbcPojoStoreFactory storeFactory = new CacheJdbcPojoStoreFactory(); storeFactory.setParallelLoadCacheMinimumThreshold(100); storeFactory.setBatchSize(100); storeFactory.setMaximumPoolSize(4); storeFactory.setDataSourceFactory(getDataSourceFactory()); storeFactory.setDialect(new H2Dialect()); storeFactory.setTypes(getJdbcType()); return storeFactory; }
/** * @return Cache configuration for test. * @throws Exception In case when failed to create cache configuration. */ protected CacheConfiguration cacheConfiguration() throws Exception { CacheConfiguration cc = defaultCacheConfiguration(); cc.setName(CACHE_NAME); cc.setCacheMode(PARTITIONED); cc.setAtomicityMode(transactional ? TRANSACTIONAL : ATOMIC); cc.setWriteBehindEnabled(false); cc.setStoreKeepBinary(storeKeepBinary()); CacheJdbcPojoStoreFactory<Object, Object> storeFactory = new CacheJdbcPojoStoreFactory<>(); storeFactory.setDialect(new H2Dialect()); storeFactory.setTypes(storeTypes()); storeFactory.setDataSourceFactory(new H2DataSourceFactory()); // H2 DataSource factory. storeFactory.setSqlEscapeAll(sqlEscapeAll()); storeFactory.setParallelLoadCacheMinimumThreshold(parallelLoadThreshold); cc.setCacheStoreFactory(storeFactory); cc.setReadThrough(true); cc.setWriteThrough(true); cc.setLoadPreviousValue(true); return cc; }
storeFactory.setDialect(new H2Dialect());