Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
FCREPO-1213: do not attempt to change read-only state of closed conne…
Browse files Browse the repository at this point in the history
…ctions
  • Loading branch information
barmintor committed Aug 14, 2014
1 parent cb30fc5 commit 19894bc
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,13 @@ public Connection getReadWriteConnection() throws SQLException {
*/
public void free(Connection connection) {
try {
// ensure connections returned to pool as read-only
setConnectionReadOnly(connection, true);
if (!connection.isClosed()) connection.close();
if (!connection.isClosed()){
// ensure connections returned to pool as read-only
setConnectionReadOnly(connection, true);
connection.close();
} else {
logger.debug("Ignoring attempt to close a previously closed connection");
}
} catch (SQLException sqle) {
logger.warn("Unable to close connection", sqle);
} finally {
Expand Down

0 comments on commit 19894bc

Please sign in to comment.