Skip to content

Commit

Permalink
Merge pull request #542 from SmiNatalia/patch-1
Browse files Browse the repository at this point in the history
Bad connection issue if autoCommit = false
  • Loading branch information
emacarron committed Apr 14, 2016
2 parents dca09fb + dcfa458 commit 0f01892
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,11 @@ private PooledConnection popConnection(String username, String password) throws
state.accumulatedCheckoutTime += longestCheckoutTime;
state.activeConnections.remove(oldestActiveConnection);
if (!oldestActiveConnection.getRealConnection().getAutoCommit()) {
oldestActiveConnection.getRealConnection().rollback();
try {
oldestActiveConnection.getRealConnection().rollback();
} catch (SQLException e) {
log.debug("Bad connection. Could not roll back");
}
}
conn = new PooledConnection(oldestActiveConnection.getRealConnection(), this);
oldestActiveConnection.invalidate();
Expand Down

0 comments on commit 0f01892

Please sign in to comment.