Skip to content

Commit

Permalink
Revise exception handling in AbstractEmbeddedDatabaseConfigurer
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Jan 13, 2020
1 parent 3f1882c commit 7987448
Showing 1 changed file with 4 additions and 9 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,6 +25,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.jdbc.support.JdbcUtils;

/**
* Base class for {@link EmbeddedDatabaseConfigurer} implementations
* providing common shutdown behavior through a "SHUTDOWN" statement.
Expand Down Expand Up @@ -53,14 +55,7 @@ public void shutdown(DataSource dataSource, String databaseName) {
logger.info("Could not shut down embedded database", ex);
}
finally {
if (con != null) {
try {
con.close();
}
catch (Throwable ex) {
logger.debug("Could not close JDBC Connection on shutdown", ex);
}
}
JdbcUtils.closeConnection(con);
}
}

Expand Down

0 comments on commit 7987448

Please sign in to comment.