mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge pull request #6118 from joshiste/1.3.x-liquibase-endpoint
* 1.3.x-liquibase-endpoint: Close connection after use in LiquibaseEndpoint
This commit is contained in:
commit
b11457f5a2
@ -54,8 +54,13 @@ public class LiquibaseEndpoint extends AbstractEndpoint<List<Map<String, ?>>> {
|
||||
DatabaseFactory factory = DatabaseFactory.getInstance();
|
||||
DataSource dataSource = this.liquibase.getDataSource();
|
||||
JdbcConnection connection = new JdbcConnection(dataSource.getConnection());
|
||||
Database database = factory.findCorrectDatabaseImplementation(connection);
|
||||
return service.queryDatabaseChangeLogTable(database);
|
||||
try {
|
||||
Database database = factory.findCorrectDatabaseImplementation(connection);
|
||||
return service.queryDatabaseChangeLogTable(database);
|
||||
}
|
||||
finally {
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException("Unable to get Liquibase changelog", ex);
|
||||
|
Loading…
Reference in New Issue
Block a user