Java Code Examples for bitronix.tm.resource.jdbc.PoolingDataSource#setMaxPoolSize()

The following examples show how to use bitronix.tm.resource.jdbc.PoolingDataSource#setMaxPoolSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Connections.java    From glowroot with Apache License 2.0 6 votes vote down vote up
static PoolingDataSource createBitronixWrappedDataSource() throws AssertionError {
    if (Connections.class.getClassLoader() instanceof IsolatedWeavingClassLoader) {
        throw new AssertionError("Bitronix loads JdbcProxyFactory implementation using a"
                + " parent-first class loader, which bypasses IsolatedWeavingClassLoader, must"
                + " use JavaagentContainer");
    }
    PoolingDataSource ds = new PoolingDataSource();
    ds.setClassName(JDBCXADataSource.class.getName());
    Properties props = new Properties();
    props.setProperty("url", "jdbc:hsqldb:mem:test");
    ds.setDriverProperties(props);
    ds.setMaxPoolSize(1);
    ds.setUniqueName("unique-name-" + nextUniqueNum++);
    ds.setAllowLocalTransactions(true);
    return ds;
}
 
Example 2
Source File: EsbUtils.java    From iaf with Apache License 2.0 6 votes vote down vote up
private static PoolingDataSource setupJdbcDataSource(String url,
		String userName, String password) {
	log.debug("setting up JdbcDataSource url [" + url + "] username ["
			+ userName + "] password ["
			+ StringUtils.repeat("*", password.length()) + "]");
	PoolingDataSource jdbcDataSource = new PoolingDataSource();
	jdbcDataSource.setClassName("oracle.jdbc.xa.client.OracleXADataSource");
	jdbcDataSource.setUniqueName("oracle");
	jdbcDataSource.setMaxPoolSize(5);
	jdbcDataSource.setAllowLocalTransactions(true);
	// jdbcDataSource.setTestQuery("SELECT 1 FROM DUAL");
	jdbcDataSource.getDriverProperties().setProperty("user", userName);
	jdbcDataSource.getDriverProperties().setProperty("password", password);
	jdbcDataSource.getDriverProperties().setProperty("URL", url);
	jdbcDataSource.init();
	return jdbcDataSource;
}
 
Example 3
Source File: JTATransactionManagerConfiguration.java    From high-performance-java-persistence with Apache License 2.0 5 votes vote down vote up
@Bean(destroyMethod = "close")
public PoolingDataSource actualDataSource() {
    PoolingDataSource poolingDataSource = new PoolingDataSource();
    poolingDataSource.setClassName(dataSourceClassName);
    poolingDataSource.setUniqueName(getClass().getName());
    poolingDataSource.setMinPoolSize(0);
    poolingDataSource.setMaxPoolSize(5);
    poolingDataSource.setAllowLocalTransactions(true);
    poolingDataSource.setDriverProperties(new Properties());
    poolingDataSource.getDriverProperties().put("user", jdbcUser);
    poolingDataSource.getDriverProperties().put("password", jdbcPassword);
    poolingDataSource.getDriverProperties().put("url", jdbcUrl);
    return poolingDataSource;
}
 
Example 4
Source File: JTAMultipleTransactionsConfiguration.java    From high-performance-java-persistence with Apache License 2.0 5 votes vote down vote up
public DataSource extraDataSource() {
    PoolingDataSource poolingDataSource = new PoolingDataSource();
    poolingDataSource.setClassName(dataSourceClassName);
    poolingDataSource.setUniqueName("ExtraDS");
    poolingDataSource.setMinPoolSize(0);
    poolingDataSource.setMaxPoolSize(5);
    poolingDataSource.setAllowLocalTransactions(true);
    poolingDataSource.setDriverProperties(new Properties());
    poolingDataSource.getDriverProperties().put("user", jdbcUser);
    poolingDataSource.getDriverProperties().put("password", jdbcPassword);
    poolingDataSource.getDriverProperties().put("databaseName", jdbcDatabase);
    poolingDataSource.getDriverProperties().put("serverName", jdbcHost);
    poolingDataSource.getDriverProperties().put("portNumber", jdbcPort);
    return poolingDataSource;
}
 
Example 5
Source File: HSQLDBJtaTransactionManagerConfiguration.java    From high-performance-java-persistence with Apache License 2.0 5 votes vote down vote up
public DataSource actualDataSource() {
    PoolingDataSource poolingDataSource = new PoolingDataSource();
    poolingDataSource.setClassName(dataSourceClassName);
    poolingDataSource.setUniqueName(getClass().getName());
    poolingDataSource.setMinPoolSize(0);
    poolingDataSource.setMaxPoolSize(5);
    poolingDataSource.setAllowLocalTransactions(true);
    poolingDataSource.setDriverProperties(new Properties());
    poolingDataSource.getDriverProperties().put("user", jdbcUser);
    poolingDataSource.getDriverProperties().put("password", jdbcPassword);
    poolingDataSource.getDriverProperties().put("url", jdbcUrl);
    return poolingDataSource;
}
 
Example 6
Source File: PostgreSQLJTATransactionManagerConfiguration.java    From high-performance-java-persistence with Apache License 2.0 5 votes vote down vote up
public DataSource actualDataSource() {
    PoolingDataSource poolingDataSource = new PoolingDataSource();
    poolingDataSource.setClassName(dataSourceClassName);
    poolingDataSource.setUniqueName(getClass().getName());
    poolingDataSource.setMinPoolSize(0);
    poolingDataSource.setMaxPoolSize(5);
    poolingDataSource.setAllowLocalTransactions(true);
    poolingDataSource.setDriverProperties(new Properties());
    poolingDataSource.getDriverProperties().put("user", jdbcUser);
    poolingDataSource.getDriverProperties().put("password", jdbcPassword);
    poolingDataSource.getDriverProperties().put("databaseName", jdbcDatabase);
    poolingDataSource.getDriverProperties().put("serverName", jdbcHost);
    poolingDataSource.getDriverProperties().put("portNumber", jdbcPort);
    return poolingDataSource;
}