Re: Statement.cancel() doesn't seem to work - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Statement.cancel() doesn't seem to work
Date
Msg-id 4BBACC12.9050204@opencloud.com
Whole thread Raw
In response to Statement.cancel() doesn't seem to work  (JN <jim.newsham@gmail.com>)
List pgsql-jdbc
JN wrote:
> Hi, I'm trying to cancel a long-running statement (takes about 400
> seconds) by calling PreparedStatement.cancel() from another thread,
> but it's not working.  Specifically, the call to
> PreparedStatement.cancel() completes normally, but the executing
> statement seems to complete normally (i.e., it still takes the same
> amount of time to complete, and it does not throw any exception).  The
> sql being executed is a delete ("delete from qos_data where
> report_time < ?").  Is PreparedStatement.cancel() not implemented?

It is implemented, but it just requests that the backend cancels any
query in progress - there are no guarantees that it will be effective.

Does the query get canceled if you manually send a SIGINT to the
relevant backend?

-O

pgsql-jdbc by date:

Previous
From: JN
Date:
Subject: Statement.cancel() doesn't seem to work
Next
From: Breno BF
Date:
Subject: Re: An I/O error occured while sending to the backend.