#2291 - ENH: Explicit option for fast-failing or not fast-failing (skipDataSourceCheck config option)

This commit is contained in:
rbygrave
2021-08-09 15:10:59 +12:00
parent 0ef5c65c94
commit 43213ead05
3 changed files with 25 additions and 0 deletions
@@ -255,6 +255,9 @@ public class DefaultContainer implements SpiContainer {
}
throw new RuntimeException("DataSource not set?");
}
if (config.skipDataSourceCheck()) {
return true;
}
try (Connection connection = config.getDataSource().getConnection()) {
if (connection.getAutoCommit()) {
logger.warn("DataSource [{}] has autoCommit defaulting to true!", config.getName());