use of org.infinispan.persistence.jdbc.configuration.JdbcStringBasedStoreConfigurationBuilder in project infinispan by infinispan.
the class JdbcStringBasedStoreMetaTest method createCacheManager.
private void createCacheManager(boolean createOnStart, int segments) {
ConfigurationBuilder cfg = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
cfg.clustering().hash().numSegments(segments);
JdbcStringBasedStoreConfigurationBuilder store = cfg.persistence().addStore(JdbcStringBasedStoreConfigurationBuilder.class).fetchPersistentState(true);
store.table().createOnStart(createOnStart);
UnitTestDatabaseManager.buildTableManipulation(store.table());
store.simpleConnection().driverClass(org.h2.Driver.class).connectionUrl(String.format("jdbc:h2:mem:%s;DB_CLOSE_DELAY=-1", JdbcStringBasedStoreMetaTest.class)).username("sa");
withCacheManager(() -> TestCacheManagerFactory.createCacheManager(cfg), Void -> {
});
}
use of org.infinispan.persistence.jdbc.configuration.JdbcStringBasedStoreConfigurationBuilder in project infinispan by infinispan.
the class TxStoreTest method beforeClass.
@BeforeMethod
public void beforeClass() {
ConfigurationBuilder cc = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
JdbcStringBasedStoreConfigurationBuilder storeBuilder = cc.clustering().cacheMode(CacheMode.DIST_SYNC).persistence().addStore(JdbcStringBasedStoreConfigurationBuilder.class).shared(true).transactional(true);
UnitTestDatabaseManager.configureUniqueConnectionFactory(storeBuilder);
UnitTestDatabaseManager.setDialect(storeBuilder);
UnitTestDatabaseManager.buildTableManipulation(storeBuilder.table());
cacheManager = TestCacheManagerFactory.createClusteredCacheManager(cc);
cache = cacheManager.getCache();
store = TestingUtil.getFirstStoreWait(cache);
}
use of org.infinispan.persistence.jdbc.configuration.JdbcStringBasedStoreConfigurationBuilder in project infinispan by infinispan.
the class JdbcStringParallelIterationTest method configurePersistence.
@Override
protected void configurePersistence(ConfigurationBuilder cb) {
JdbcStringBasedStoreConfigurationBuilder storeBuilder = cb.persistence().addStore(JdbcStringBasedStoreConfigurationBuilder.class);
UnitTestDatabaseManager.configureUniqueConnectionFactory(storeBuilder);
UnitTestDatabaseManager.buildTableManipulation(storeBuilder.table());
}
Aggregations