comparison backend/src/main/java/org/dive4elements/river/backend/utils/DBCPConnectionProvider.java @ 8485:026f4c684ee5

Make maxWait configurable and wait for 30 seconds
author "Tom Gottfried <tom@intevation.de>"
date Fri, 28 Nov 2014 16:34:40 +0100
parents 8c615d738e84
children d718edbf0b0c
comparison
equal deleted inserted replaced
8484:8c615d738e84 8485:026f4c684ee5
215 String validationQuery = props.getProperty("validationQuery"); 215 String validationQuery = props.getProperty("validationQuery");
216 if (validationQuery != null) { 216 if (validationQuery != null) {
217 ds.setValidationQuery(validationQuery); 217 ds.setValidationQuery(validationQuery);
218 } 218 }
219 219
220 ds.setMaxWait(1000); //TODO: make it configurable 220 String maxWait = props.getProperty("maxWait");
221 if (maxWait != null) {
222 try {
223 ds.setMaxWait(Integer.parseInt(maxWait));
224 }
225 catch (NumberFormatException nfe) {
226 log.error(
227 "Property maxWait could not be parsed as integer."
228 );
229 }
230 }
221 231
222 // The BasicDataSource has lazy initialization 232 // The BasicDataSource has lazy initialization
223 // borrowing a connection will start the DataSource 233 // borrowing a connection will start the DataSource
224 // and make sure it is configured correctly. 234 // and make sure it is configured correctly.
225 235

http://dive4elements.wald.intevation.org