Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,17 @@ void closeConnectionFully(boolean logErrors) {
Log.warn("Error when closing connection Statements", ex);
}
}
try {
// DB2 (and some other DBMS) may have uncommitted changes and do not allow close
// so try to do a rollback.
if (!connection.getAutoCommit()) {
connection.rollback();
}
} catch (SQLException ex) {
if (logErrors) {
Log.warn("Could not perform rollback", ex);
}
}
try {
connection.close();
pool.dec();
Expand Down
Loading