Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2DF5F633F70 for ; Tue, 6 Apr 2010 02:52:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 91245-02 for ; Tue, 6 Apr 2010 05:52:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 9BA98633632 for ; Tue, 6 Apr 2010 02:52:22 -0300 (ADT) Received: from deluge.opencloud.co.nz ([192.168.0.16]) by tremor.opencloud.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Nz1hy-0007nT-Tt; Tue, 06 Apr 2010 17:52:18 +1200 Message-ID: <4BBACC12.9050204@opencloud.com> Date: Tue, 06 Apr 2010 17:52:18 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: JN CC: pgsql-jdbc@postgresql.org Subject: Re: Statement.cancel() doesn't seem to work References: <123b6e3e-7744-4bd6-a470-59e98e1b9141@r27g2000yqn.googlegroups.com> In-Reply-To: <123b6e3e-7744-4bd6-a470-59e98e1b9141@r27g2000yqn.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.185 tagged_above=-10 required=5 tests=BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 201004/4 X-Sequence-Number: 20415 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