Created
December 16, 2012 20:50
-
-
Save ipolevoy/4312786 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void close() { | |
try { | |
Connection connection = ConnectionsAccess.getConnection(dbName); | |
if(connection == null){ | |
throw new DBException("cannot close connection '" + dbName + "' because it is not available"); | |
} | |
StatementCache.instance().cleanStatementCache(connection); | |
connection.close(); | |
LogFilter.log(logger, "Closed connection: " + connection); | |
} catch (Exception e) { | |
logger.warn("Could not close connection! MUST INVESTIGATE POTENTIAL CONNECTION LEAK!", e); | |
}finally{ | |
ConnectionsAccess.detach(dbName);// lets free the thread from connection | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment