Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id DB2A1633952 for ; Wed, 4 Mar 2009 19:36:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 37574-07 for ; Wed, 4 Mar 2009 19:36:18 -0400 (AST) X-Greylist: delayed 00:25:02.213254 by SQLgrey-1.7.6 Received: from gateway.resolution.com (gateway.resolutionsoft.com [216.167.178.178]) by mail.postgresql.org (Postfix) with ESMTP id 521086335E8 for ; Wed, 4 Mar 2009 19:36:18 -0400 (AST) Received: from [192.168.5.110] ([192.168.5.110]) by gateway.resolution.com (8.13.1/8.13.1) with ESMTP id n24NBBxf000638 for ; Wed, 4 Mar 2009 17:11:11 -0600 Subject: canceling query due to user request From: Anthony Presley To: pgsql-jdbc@postgresql.org Content-Type: text/plain Date: Wed, 04 Mar 2009 17:11:10 -0600 Message-Id: <1236208270.3656.46.camel@dellLaptop.resolution.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-5.fc8) Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/16 X-Sequence-Number: 19346 Hi, We recently acquired a multi-threaded JDBC reporting tool (for which we do not have the source), which are running against PostgreSQL 8.3.6, using the latest Type3 JDBC driver (I have also tried the Type4). After a number of requests for reports (which are all fine), PostgreSQL appears to start dropping connections, and we start seeing these in the logs: [ERROR] Mar 4, 2009 4:46:17 PM: ERROR: canceling statement due to user request org.postgresql.util.PSQLException: ERROR: canceling statement due to user request at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1608) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1343) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:194) After doing a lot of Google searching, it appears that Oliver Jowett encountered this problem a number of years ago (2003?), and discovered a race condition in the JDBC driver relating to a Statement.Cancel command. However, later in 2004 and again in 2005, I found these threads: http://archives.postgresql.org/pgsql-jdbc/2004-09/msg00027.php http://archives.postgresql.org/pgsql-jdbc/2005-09/msg00046.php Which imply that the patch hasn't been addressed. I haven't ruled out that the report vendor isn't messing up their own query cancellations, but I'm doing what I can to make sure that the problem is on their end. Has the patch to stop this condition been applied? If not, what do I need to do to apply it? Is it likely that the problem is the vendor, or is this due to the Statement Cancel being called? Thanks very much. -- Anthony