public JdbcStoreReader(StoreProperties props) { this.props = props; this.marshaller = SerializationConfigUtil.getMarshaller(props); this.config = JdbcConfigurationUtil.getStoreConfig(props); this.connectionFactory = new PooledConnectionFactory(); String segmentCount = props.get(Element.SEGMENT_COUNT); this.metaData = new DbMetaData(config.dialect(), config.dbMajorVersion(), config.dbMinorVersion(), false, false, // If we don't have segments then disable it segmentCount == null || Integer.parseInt(segmentCount) <= 0); this.stringConfig = config.table(); this.binaryConfig = createBinaryTableConfig(); connectionFactory.start(config.connectionFactory(), JdbcStoreReader.class.getClassLoader()); }
public static TableManager getManager(ConnectionFactory connectionFactory, JdbcStringBasedStoreConfiguration config) { DbMetaData metaData = getDbMetaData(connectionFactory, config.dialect(), config.dbMajorVersion(), config.dbMinorVersion(), isPropertyDisabled(config, UPSERT_DISABLED), isPropertyDisabled(config, INDEXING_DISABLED), !config.segmented()); return getManager(metaData, connectionFactory, config.table()); }
assertTrue(store.shared()); assertTrue(store.preload()); assertEquals(DatabaseType.H2, store.dialect()); PooledConnectionFactoryConfiguration connectionFactory = (PooledConnectionFactoryConfiguration) store.connectionFactory(); assertEquals("jdbc:h2:mem:infinispan;DB_CLOSE_DELAY=-1", connectionFactory.connectionUrl());