Handle the exception when cancel query failed.
This commit is contained in:
@ -178,6 +178,7 @@ public abstract class QueryExecutorBase implements QueryExecutor {
|
||||
} catch (IOException e) {
|
||||
// Safe to ignore.
|
||||
LOGGER.trace("Ignoring exception on cancel request:", e);
|
||||
throw new SQLException("Cancel request on this connection failed");
|
||||
} finally {
|
||||
if (cancelStream != null) {
|
||||
try {
|
||||
|
||||
@ -1143,7 +1143,11 @@ public class PgConnection implements BaseConnection {
|
||||
@Override
|
||||
public void cancelQuery() throws SQLException {
|
||||
checkClosed();
|
||||
try {
|
||||
queryExecutor.sendQueryCancel();
|
||||
} catch (SQLException e) {
|
||||
queryExecutor.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user