private DataSource createDatasource0(PersistenceParser parser) { try { // read the properties final String jdbcDriver = (String) this.getProperty(JPASettings.JDBC_DRIVER); final String jdbcUrl = (String) this.getProperty(JPASettings.JDBC_URL); final String jdbcUser = (String) this.getProperty(JPASettings.JDBC_USER); final String jdbcPassword = (String) this.getProperty(JPASettings.JDBC_PASSWORD); final Integer statementsCacheSize = this.getProperty(BJPASettings.STATEMENT_CACHE_SIZE) != null ? // Integer.valueOf((String) this.getProperty(BJPASettings.STATEMENT_CACHE_SIZE)) : // BJPASettings.DEFAULT_STATEMENT_CACHE_SIZE; final Integer minConnections = this.getProperty(BJPASettings.MIN_CONNECTIONS) != null ? // Integer.valueOf((String) this.getProperty(BJPASettings.MIN_CONNECTIONS)) : // BJPASettings.DEFAULT_MIN_CONNECTIONS; // create the datasource final BoneCPDataSource dataSource = new BoneCPDataSource(); dataSource.setDriverClass(jdbcDriver); dataSource.setJdbcUrl(jdbcUrl); dataSource.setUsername(jdbcUser); dataSource.setPassword(jdbcPassword); dataSource.setStatementsCacheSize(statementsCacheSize); dataSource.setMinConnectionsPerPartition(minConnections); dataSource.setMaxConnectionsPerPartition(5); dataSource.setDisableConnectionTracking(true); // This is slow so always set it to 0 dataSource.setReleaseHelperThreads(0); return dataSource; } catch (final Exception e) { throw new IllegalArgumentException("Illegal values for datasource settings!"); } }