atomikosDataSourceBean.setMinPoolSize(getMinPoolSize()); atomikosDataSourceBean.setDefaultIsolationLevel(getDefaultIsolationLevel()); atomikosDataSourceBean.setMaintenanceInterval(getMaintenanceInterval());
private void setPoolProperties(final AtomikosDataSourceBean dataSourceBean, final YamlDataSourceParameter parameter) { dataSourceBean.setMaintenanceInterval((int) (parameter.getMaintenanceIntervalMilliseconds() / 1000)); dataSourceBean.setMinPoolSize(parameter.getMinPoolSize() < 0 ? 0 : parameter.getMinPoolSize()); dataSourceBean.setMaxPoolSize(parameter.getMaxPoolSize()); dataSourceBean.setBorrowConnectionTimeout((int) parameter.getConnectionTimeoutMilliseconds() / 1000); dataSourceBean.setReapTimeout((int) parameter.getMaxLifetimeMilliseconds() / 1000); dataSourceBean.setMaxIdleTime((int) parameter.getIdleTimeoutMilliseconds() / 1000); }
private void setPoolProperties(final AtomikosDataSourceBean dataSourceBean, final YamlDataSourceParameter parameter) { dataSourceBean.setMaintenanceInterval((int) (parameter.getMaintenanceIntervalMilliseconds() / 1000)); dataSourceBean.setMinPoolSize(parameter.getMinPoolSize() < 0 ? 0 : parameter.getMinPoolSize()); dataSourceBean.setMaxPoolSize(parameter.getMaxPoolSize()); dataSourceBean.setBorrowConnectionTimeout((int) parameter.getConnectionTimeoutMilliseconds() / 1000); dataSourceBean.setReapTimeout((int) parameter.getMaxLifetimeMilliseconds() / 1000); dataSourceBean.setMaxIdleTime((int) parameter.getIdleTimeoutMilliseconds() / 1000); }
@Override public void setMinPool(int minPool) { super.setMinPoolSize(minPool); }
atomikosDataSourceBean.setMinPoolSize(getMinPoolSize()); atomikosDataSourceBean.setDefaultIsolationLevel(getDefaultIsolationLevel()); atomikosDataSourceBean.setMaintenanceInterval(getMaintenanceInterval());
private void setPoolProperties(final DataSourceParameter parameter) { delegate.setMaintenanceInterval((int) (parameter.getMaintenanceIntervalMilliseconds() / 1000)); delegate.setMinPoolSize(parameter.getMinPoolSize() < 0 ? 0 : parameter.getMinPoolSize()); delegate.setMaxPoolSize(parameter.getMaxPoolSize()); delegate.setBorrowConnectionTimeout((int) parameter.getConnectionTimeoutMilliseconds() / 1000); delegate.setReapTimeout((int) parameter.getMaxLifetimeMilliseconds() / 1000); delegate.setMaxIdleTime((int) parameter.getIdleTimeoutMilliseconds() / 1000); }
@Override public DataSource wrap(String name, XADataSource xaDataSource, PoolOptions poolOptions, String testQuery) { AtomikosDataSourceBean wrapped = new AtomikosDataSourceBean(); wrapped.setXaDataSource(xaDataSource); wrapped.setUniqueResourceName(name); if (poolOptions == null) { poolOptions = new PoolOptions(); } if (poolOptions.getMaxLifeTime() != null && poolOptions.getMaxLifeTime() != 0) { wrapped.setMaxLifetime(poolOptions.getMaxLifeTime()); } else { // test query is only needed when we don't know how long Atomikos can keep connections in the pool wrapped.setTestQuery(testQuery); } if (poolOptions.getMinPoolSize() != null) { wrapped.setMinPoolSize(poolOptions.getMinPoolSize()); } if (poolOptions.getMaxPoolSize() != null) { wrapped.setMaxPoolSize(poolOptions.getMaxPoolSize()); } if (poolOptions.getMaxIdleTime() != null) { wrapped.setMaxIdleTime(poolOptions.getMaxIdleTime()); } if (poolOptions.getReapTimeout() != null) { wrapped.setReapTimeout(poolOptions.getReapTimeout()); } return wrapped; }