Description
In the class org.apache.ftpserver.usermanager.impl.DbUserManager the ctor doesn't close the test connection and keeps it open until it is close by for example the connection pooling or so. It should be closed directly.
Currently the code is:
try {
// test the connection
createConnection();
LOG.info("Database connection opened.");
} catch (SQLException ex) {
LOG.error("Failed to open connection to user database", ex);
throw new FtpServerConfigurationException(
"Failed to open connection to user database", ex);
}
It should be something like this:
Connection con = null;
try {
// test the connection
con = createConnection();
LOG.info("Database connection opened.");
} catch (SQLException ex) {
LOG.error("Failed to open connection to user database", ex);
throw new FtpServerConfigurationException(
"Failed to open connection to user database", ex);
} finally{
closeQuitely(con);
}