mirror of https://github.com/apache/cloudstack.git
coverity 1116668: conditionally close ds provided connection
Signed-off-by: Daan Hoogland <daan@onecht.net> This closes #599
This commit is contained in:
parent
4f1eb8d6dd
commit
03b076cd1b
|
|
@ -71,7 +71,15 @@ public class Merovingian2 extends StandardMBean implements MerovingianMBean {
|
|||
_concierge = new ConnectionConcierge("LockMaster", conn, true);
|
||||
} catch (SQLException e) {
|
||||
s_logger.error("Unable to get a new db connection", e);
|
||||
throw new CloudRuntimeException("Unable to initialize a connection to the database for locking purposes: ", e);
|
||||
throw new CloudRuntimeException("Unable to initialize a connection to the database for locking purposes", e);
|
||||
} finally {
|
||||
if (_concierge == null && conn != null) {
|
||||
try {
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
s_logger.debug("closing connection failed after everything else.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue