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) {
|
} catch (IOException e) {
|
||||||
// Safe to ignore.
|
// Safe to ignore.
|
||||||
LOGGER.trace("Ignoring exception on cancel request:", e);
|
LOGGER.trace("Ignoring exception on cancel request:", e);
|
||||||
|
throw new SQLException("Cancel request on this connection failed");
|
||||||
} finally {
|
} finally {
|
||||||
if (cancelStream != null) {
|
if (cancelStream != null) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -1143,7 +1143,11 @@ public class PgConnection implements BaseConnection {
|
|||||||
@Override
|
@Override
|
||||||
public void cancelQuery() throws SQLException {
|
public void cancelQuery() throws SQLException {
|
||||||
checkClosed();
|
checkClosed();
|
||||||
|
try {
|
||||||
queryExecutor.sendQueryCancel();
|
queryExecutor.sendQueryCancel();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
queryExecutor.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user