int maxPoolSize = DBConstants.DEFAULT_DBCP_MAX_POOL_SIZE;
try {
if (!DBUtils.isEmptyString(minPool)) {
minPoolSize = Integer.valueOf(minPool).intValue();
if (minPoolSize < 0) {
throw new DataServiceFault("Minimum pool size '" + minPoolSize +
"' should be a positive value in config '" + this.getConfigId() + "'");
}
}
} catch (NumberFormatException e) {
throw new DataServiceFault(e, "Invalid minimum pool size '" + minPool + "' in config '" +
this.getConfigId() + "'");
}
try {
if (!DBUtils.isEmptyString(maxPool)) {
maxPoolSize = Integer.valueOf(maxPool).intValue();
}
} catch (NumberFormatException e) {
throw new DataServiceFault(e, "Invalid maximum pool size '" + maxPool + "' in config '" +
this.getConfigId() + "'");
}
if (!DBUtils.isEmptyString(minPool) && !DBUtils.isEmptyString(maxPool)) {
if (minPoolSize > maxPoolSize) {
throw new DataServiceFault("Minimum pool size is greater than maximum pool size in config '" +
this.getConfigId() + "'");
}
}
}