mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Simonis (JIRA)" <j...@apache.org>
Subject [jira] Created: (FTPSERVER-379) DbUserManager doesn't close test connection in ctor
Date Mon, 12 Jul 2010 07:28:49 GMT
DbUserManager doesn't close test connection in ctor
---------------------------------------------------

                 Key: FTPSERVER-379
                 URL: https://issues.apache.org/jira/browse/FTPSERVER-379
             Project: FtpServer
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.0.4
            Reporter: Dirk Simonis
            Priority: Minor


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);
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message