mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge pull request #38924 from skcskitano
* pr/38924: Fix connection leak in SqlDialectLookup Closes gh-38924
This commit is contained in:
commit
45d2c3b0ca
@ -46,8 +46,7 @@ final class SqlDialectLookup {
|
||||
* @return the most suitable {@link SQLDialect}
|
||||
*/
|
||||
static SQLDialect getDialect(DataSource dataSource) {
|
||||
try {
|
||||
Connection connection = (dataSource != null) ? dataSource.getConnection() : null;
|
||||
try (Connection connection = (dataSource != null) ? dataSource.getConnection() : null) {
|
||||
return JDBCUtils.dialect(connection);
|
||||
}
|
||||
catch (SQLException ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user