diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2012-01-01 21:48:15 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2012-01-01 21:48:15 +0100 |
commit | 9215b60984179e3fc28cea11a032556de4f7abdf (patch) | |
tree | 9bff4660b874f5af517d8ed4a9380235e12c709a /sonar-core | |
parent | 7a87485a457afd837eb89a1df66d2287b122171d (diff) | |
download | sonarqube-9215b60984179e3fc28cea11a032556de4f7abdf.tar.gz sonarqube-9215b60984179e3fc28cea11a032556de4f7abdf.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/persistence/DatabaseMigrator.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseMigrator.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseMigrator.java index 889bcd2014f..3e6e5623862 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseMigrator.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseMigrator.java @@ -51,7 +51,15 @@ public class DatabaseMigrator implements ServerComponent { try { DdlUtils.createSchema(connection, database.getDialect().getId()); } finally { - session.close(); + try { + session.close(); + + // The connection is probably already closed by session.close() + // but it's not documented in mybatis javadoc. + connection.close(); + } catch (Exception e) { + // ignore + } } return true; } |