managedConnectionFactory.setPreparedStatementCacheSize(statement.getPreparedStatementsCacheSize()
.intValue());
}
}
final Validation validation = dataSourceConfig.getValidation();
if (validation != null) {
if (validation.isValidateOnMatch() != null) {
managedConnectionFactory.setValidateOnMatch(validation.isValidateOnMatch());
}
if (validation.getCheckValidConnectionSql() != null) {
managedConnectionFactory.setCheckValidConnectionSQL(validation.getCheckValidConnectionSql());
}
final Extension validConnectionChecker = validation.getValidConnectionChecker();
if (validConnectionChecker != null) {
if (validConnectionChecker.getClassName() != null) {
managedConnectionFactory.setValidConnectionCheckerClassName(validConnectionChecker.getClassName());
}
if (validConnectionChecker.getConfigPropertiesMap() != null) {
managedConnectionFactory
.setValidConnectionCheckerProperties(buildConfigPropsString(validConnectionChecker
.getConfigPropertiesMap()));
}
}
final Extension exceptionSorter = validation.getExceptionSorter();
if (exceptionSorter != null) {
if (exceptionSorter.getClassName() != null) {
managedConnectionFactory.setExceptionSorterClassName(exceptionSorter.getClassName());
}
if (exceptionSorter.getConfigPropertiesMap() != null) {
managedConnectionFactory.setExceptionSorterProperties(buildConfigPropsString(exceptionSorter
.getConfigPropertiesMap()));
}
}
final Extension staleConnectionChecker = validation.getStaleConnectionChecker();
if (staleConnectionChecker != null) {
if (staleConnectionChecker.getClassName() != null) {
managedConnectionFactory.setStaleConnectionCheckerClassName(staleConnectionChecker.getClassName());
}
if (staleConnectionChecker.getConfigPropertiesMap() != null) {