Skip to content

Commit

Permalink
Merge pull request spring-projects#6118 from joshiste/1.3.x-liquibase…
Browse files Browse the repository at this point in the history
…-endpoint

* 1.3.x-liquibase-endpoint:
  Close connection after use in LiquibaseEndpoint
  • Loading branch information
philwebb committed Jun 11, 2016
2 parents 452281c + e89063c commit b11457f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ public LiquibaseEndpoint(SpringLiquibase liquibase) {
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);
Expand Down

0 comments on commit b11457f

Please sign in to comment.