Skip to content

Commit

Permalink
Merge branch 'main' into feature/6963_qute_iterate_long
Browse files Browse the repository at this point in the history
  • Loading branch information
DaHoC authored Jul 4, 2024
2 parents f179993 + ac13706 commit 3b542d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ public interface DataSourceJdbcRuntimeConfig {
*/
Optional<String> validationQuerySql();

/**
* Forces connection validation prior to acquisition (foreground validation) regardless of the idle status.
* <p>
* Because of the overhead of performing validation on every call, it’s recommended to rely on default idle validation
* instead, and to leave this to `false`.
*/
@WithDefault("false")
boolean validateOnBorrow();

/**
* Disable pooling to prevent reuse of Connections. Use this when an external pool manages the life-cycle
* of Connections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ public boolean isValid(Connection connection) {
}
});
}
poolConfiguration.validateOnBorrow(dataSourceJdbcRuntimeConfig.validateOnBorrow());
poolConfiguration.reapTimeout(dataSourceJdbcRuntimeConfig.idleRemovalInterval());
if (dataSourceJdbcRuntimeConfig.leakDetectionInterval().isPresent()) {
poolConfiguration.leakTimeout(dataSourceJdbcRuntimeConfig.leakDetectionInterval().get());
Expand Down

0 comments on commit 3b542d7

Please sign in to comment.